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;
}
}
qq_青枣工作室_0
相关分类