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

public class XXK3 {
public static void main(String[] args) {
Shape x;
x=new Rectangle(5,8);
System.out.println(x.area()+", "+x.girth());
}
}



【A.】40.0, 26.0
【B.】80.0, 42.0

参考答案