以下内容在同一个源程序中: interface A { int add(); } class B implements A { int x y; B(int
已帮助 人
以下内容在同一个源程序中: interface A { int add(); } class B implements A { int x,y; B(int x,int y) { this.x=x; this.y=y; } int add() { return x+y; } } public class C { public static void main(String[] args) { B b=new B(10,20); int result=b.add(); System.out.println(b.x); System.out.println(b.y); System.out.println(result); } } 对于这个源程序,以下选项正确的是()。
A.程序输出b.x的值为0
B.程序输出b.y的值为0
C.程序输出的result的值为30
D.上述源程序编译不通过

回答
共1条回复-
上述源程序编译不通过
