这里为什么要用继承
class Car {
private static $speed = 10;
public static function getSpeed() {
return self::$speed;
}
public static function speedUp() {
return self::$speed+=10;
}
}
class BigCar extends Car {
public static function start() {
parent::speedUp();
}
}BigCar::start();echo BigCar::getSpeed();
我可不可以吧BIGCAR也写成静态的方法?然后去调用speedUp()?如果能要怎么写?