Blogger Information
Blog 49
fans 0
comment 4
visits 41178
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
类的继承实例应用
过儿的博客
Original
1064 people have browsed it

实例

      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(); ?>

运行实例 »

点击 "运行实例" 按钮查看在线实例

1.png

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply withNews Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!