Day3課題2

q5の1~3まで終了
This commit is contained in:
2026-09-17 13:55:31 +09:00
parent 012cbcd562
commit 439556d4cc
9 changed files with 90 additions and 9 deletions

22
em-oop/src/Rectangle.java Normal file
View File

@@ -0,0 +1,22 @@
public class Rectangle extends Shape {
private double width;
private double height; {
}
public Rectangle(double width, double height) {
super("四角形");
this.width = width;
this.height = height;
}
public double area() {
return width * height;
}
// public void showInfo(){
// super.showInfo();
// System.out.println("(半径:" + this.area + ")");
// }
}