注意:此页面搜索的是所有试题
class Rectangle {
private int a,b;
public Rectangle(int aa, int bb) {a=aa; b=bb;}
public int area() {return a*b;}
public int girth() {return 2*(a+b);}
}

public class XXK3 extends Rectangle {
private int c;
public XXK3(int aa, int bb, int cc) {super(aa,bb); c=cc;}
public int volume() {return area()*c;}
public int arrisLength() {return 2*girth()+4*c;}

public static void main(String[] args) {
XXK3 x=new XXK3(1,3,5);
int y1=x.volume();
int y2=x.arrisLength();
System.out.println(y1+", "+y2);
}
}

【A.】20, 40
【B.】15, 36

参考答案