2.定义图形类Shape,该类中有得到面积的方法getArea();定义长方形类Rect,该类是Shape的子类,类中有矩形长和宽的变量double a,double b,设置长和宽的方法setWid

// 图形类Shape package d922B;html public class Shape { double getArea(ShapePara x){ return x.getArea(); } double getArea(Rect y) { return y.getA()*y.getB(); }markdown } //矩形类 package d922B;post public cl
相关文章
相关标签/搜索