wozcm
幼苗
共回答了19个问题采纳率:100% 举报
public interface Shape {
public double getArea();
}
public class Rectangle implements Shape{
public double width ;
public double length;
public Rectangle() {
}
public Rectangle(double width,double length) {
this.width=width;
this.length=length;
}
public double getArea(){
return width*length;
}
/* 属性的getter和setter*/
}
其他形状的方法差不多的,改一下参数和返回值
1年前
3