java 4-3的问题 先写了这么点 编译出错 提问一下在rectangle中显示The type rectangle must implement the inherited abstract method shape.area()我不是重写了抽象方法了吗?原来的抽象的不能省去?该怎么该?public abstract class shape { public abstract int perimeter(); public abstract int area();}public class rectangle extends shape { public int perimeter(int n, int m) {//计算周长 // TODO Auto-generated method stub int sum; sum=2*(n+m); return sum; } public int area(int n, int m) {//计算面积 // TODO Auto-generated method stub int sum; sum=n*m; return sum; }}
1 回答
已采纳
qq_青枣工作室_0
TA贡献446条经验 获得超754个赞
public abstract int perimeter();
public abstract int area();
上面少了参数 (int n, int m)
添加回答
举报
0/150
提交
取消