Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface iProgrammer
- {
- public function __construct($name, $salary); // задаем имя и зарплату
- public function getName(); // получить имя
- public function getSalary(); // получить зарплату
- public function getLangs(); // получить массив языков, которые знает программист
- public function addLang($lang); // добавить язык в массив языков
- }
- class Employee implements iProgrammer
- {
- private $name;
- private $salary;
- public function __construct($name, $salary)
- {
- $this->name = $name;
- $this->salary = $salary;
- }
- public function getName()
- {
- return $this->name;
- }
- public function getSalary()
- {
- return $this->salary;
- }
- }
- class Programmer extends Employee implements iProgrammer
- {
- public function addLang($lang)
- {
- // реализация
- }
- public function getLangs()
- {
- // реализация
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement