abstractclassA{private$name;function__construct($param){$this->name='liming'.'
';}functiongetName(){echo$this->name;}//调用子类中的方法getAge2functiongetAge(){$this->getAge2();}functiongetAge3(){return'23';}}classBextendsA{functiongetAge2(){echo$this->getAge3();}}$a=newB('a');$a->getName();$a->getAge();
相关分类