注意:此页面搜索的是所有试题
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(2,3,4);
int y1=x.volume();
int y2=x.arrisLength();
System.out.println(y1+", "+y2);
}
}

【A.】24, 36
【B.】26, 38

参考答案