[单选题]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( ));}}
北开题库
|
2023-10-01 08:01:13
|
21
[单选题]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.50.0, 36.0
B.40.0, 26.0
查看答案

国家开放大学

形成性考核

您可能感兴趣的试题
TOP