PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- /**
- * Created by PhpStorm.
- * User: ivan
- * Date: 22.10.14
- * Time: 11:55
- */
- /*Абстрактный класс Abstractbicycle в котором есть переменные: фирма, вес, количество скоростей. Велосипед может катиться и остановиться */
- /* В абстрактном классе Abstractbicycle есть абстрактный метод show()*/
- abstract class AbstractBicycle
- {
- public $brand;
- public $weight;
- public $speedNumber;
- abstract public function show();
- /*================Set Values==================*/
- public function setBrand($brand)
- {
- $this->brand = $brand;
- }
- public function setWeight($weight)
- {
- $this->weight = $weight;
- }
- public function setSpeedNumber($speedNumber)
- {
- $this->$speedNumber = $speedNumber;
- }
- /*================Get Values===================*/
- public function getBrand()
- {
- return $this->brand;
- }
- public function getWeight()
- {
- return $this->weight;
- }
- public function getSpeedNumber()
- {
- return $this->speedNumber;
- }
- public function roll()
- {
- return 'rolling';
- }
- public function brake()
- {
- return 'brake';
- }
- }