首先 这个题目就有点问题 因为private属性是不能被继承的请仔细看这句话如果父类有私有的属性。那么父类的方法只为父类的私有属性服务。下面通过一系列列子来加深理解.这个例子看起来很奇怪,在子类中重新定义了一个属性$sal,系统却返回了父类的属性。<?class employee{ private $sal=3000; //protected $sal=3000; public function getSal(){ return $this->sal; } }class Manager extends employee... Read More
posted @ 2012-12-11 19:09 qiusnay Views(462) Comments(0) Diggs(0)