Day3 Stept2
This commit is contained in:
21
em-oop/src/day3Keisho/Rectangle.java
Normal file
21
em-oop/src/day3Keisho/Rectangle.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package day3Keisho;
|
||||
|
||||
public class Rectangle extends Shape {
|
||||
private double width;
|
||||
private double height;
|
||||
|
||||
|
||||
public Rectangle(double width,double height) {
|
||||
super("四角形");
|
||||
this.height=height;
|
||||
this.width=width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double area() {
|
||||
// TODO 自動生成されたメソッド・スタブ
|
||||
//super.showInfo();
|
||||
return width*height;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user