问题
单项选择题
下列程序的输出结果是( )。 interface Inter{ public final static int A=100; } class My implements Inter{ public static void main (String args[ ]) {System.out.println(A) ; }
A.X=3 Y=5 X=3 Y=5 H=4 W=6
B.X=3 Y=5 X=3 Y=5 H=3 W=6
C.X=3 Y=5 X=3 Y=4 H=4 W=6
D.X=3 Y=5 X=3 Y=3 H=4 W=6
答案
参考答案:A
解析:本题考查的是对重载函数的掌握,因为++a是右结合的,所以a先自加1再输出,即为2.2,之后调用函数print(int a,int b)输出b和a,即43。