/
pandapo777
/
JavaStepik
Обзор
Документация
Войти
/
pandapo777
/
JavaStepik
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
OOP/src/inheritance/CatFamily.java
36 строк
678 B
pandapo777
ДЗ интерфейсы
06 апр 2025, 00:20
06 апр 2025, 00:20
56ecf60
Код
Авторство
О чём код?
package inheritance; public class CatFamily { protected int legs; protected int eyes; protected boolean canEatPerson; // public CatFamily() { // this.legs = 4; // this.eyes = 2; // this.canEatPerson = true; // } public CatFamily(int legs, int eyes, boolean canEatPerson) { this.legs = legs; this.eyes = eyes; this.canEatPerson = canEatPerson; } public int getEyes() { return eyes; } public int getLegs() { return legs; } public boolean isCanEatPerson() { return canEatPerson; } public void eat(){ System.out.println("Кушаю"); } }