Correction status:qualified
Teacher's comments:
Document num = $num; $this->price = $price; } public function getMoney(){ return '总共费用:'. $this->num*$this->price.'元'; } } //实现子类继承 class demo02 extends demo01{ public $name = '苹果'; } $obj = new demo02(4,20); echo $obj->name.'的'.$obj -> getMoney(); ?>
点击 "运行实例" 按钮查看在线实例