<?phpclass Car { public $speed = 0; //增加speedUp方法,使speed加10 public function speedUp(){ $this->speed+=10; }}$car = new Car();$car->speedUp();echo $car->speed;
添加回答
举报
0/150
提交
取消