在线题库
[单选] 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()); } }
发布时间:2022-09-12
0次