/
Skob.m.a
/
WorkSpace
Обзор
Документация
Войти
/
Skob.m.a
/
WorkSpace
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Task_7_2_Rectangle
55 строк
1 KB
Skob.m.a
create Task_7_2_Rectangle
01 дек 2024, 20:29
01 дек 2024, 20:29
81c8dfd
Код
Авторство
О чём код?
public class Rectangle extends Shape { protected double width; protected double length; public Rectangle(double width, double length) { this.width = width; this.length = length; } public Rectangle(double width, double length, String color, boolean filled) { super(color, filled); this.width = width; this.length = length; } public Rectangle() { } public double getWidth() { return width; } public void setWidth(double width) { this.width = width; } public double getLength() { return length; } public void setLength(double length) { this.length = length; } @Override double getArea() { return width * length; } @Override double getPerimetr() { return 2 * (width + length); } @Override public String toString() { return "Rectangle{" + "width=" + width + ", length=" + length + ", color='" + color + '\'' + ", filled=" + filled + '}'; } }