22 lines
369 B
Java
22 lines
369 B
Java
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;
|
|
}
|
|
|
|
}
|