classSuper{2.privateinta;3.protectedSuper(inta){this.a=a;}4.}.....11.classSubextendsSuper{12.publicSub(inta){super(a);}13.publicSub(){this.a=5;}14.}Whichtwo,independently,willallowSubtocompile?() A.Changeline2to:publicinta;B.Changeline2to:protectedinta;C.Changeline13to:publicSub(){this(5);}D.Changeline13to:publicSub(){super(5);}E.Changeline13to:publicSub(){super(a);}
classSuper{2.privateinta;3.protectedSuper(inta){this.a=a;}4.}.....11.classSubextendsSuper{12.publicSub(inta){super(a);}13.publicSub(){this.a=5;}14.}Whichtwo,independently,willallowSubtocompile?()
A.Changeline2to:publicinta;
B.Changeline2to:protectedinta;
C.Changeline13to:publicSub(){this(5);}
D.Changeline13to:publicSub(){super(5);}
E.Changeline13to:publicSub(){super(a);}
相关考题:
Given:1.publicclassMethodOver{2.publicvoidsetVar(inta,intb,floatc){3.}4.}WhichtwooverloadthesetVarmethod()? A.privatevoidsetVar(inta,floatc,intb){}B.protectedvoidsetVar(inta,intb,floatc){}C.publicintsetVar(inta,floatc,intb){returna:}D.publicintsetVar(inta,intb,floatc){returna:}E.protectedfloatsetVar(inta,intb,floatc){returnc:}
如果想使下列数组a中5个元素的值全部为0,可以写成( )。 A、int a[5]={0:5};B、int a[5]={0};C、int a[5]={5:0};D、int a[5]={0,0,0,0,0};E、int a[5]=0;
下面选项中等价的是:A.int a[2][3]={1,0,2,2,4,5}与int a[2][]= {1,0,2,2,4,5};B.int a[][3]= {1,0,2,2,4,5}与int a[2][3]= {1,0,2,2,4,5};C.int a[2][3]={3,4,5}与int a[][3]={3,4,5};D.int a[2][3]={0,1}与int a[2][3]={{0},{1}};
以下内容在同一个源程序中: class A { int a; A(int a) { this.a=a; } int add() { return a+10; } } class TestA { public static void f(A t) { System.out.println(t.add()); } public static void main(String[] args) { f(new A() { int add() { return a+20; } } ); } } 则()。A.程序的运行结果为输出0B.程序的运行结果为输出10C.程序的运行结果为输出20D.程序不能编译通过
以下能正确地定义整型变量a,b和c并为它们都赋初值为5的语句是 。 A、int a=b=c=5; B、int a,b,c=5; C、int a=5,b=5,c=5; D、int a,c=b=5;A.int a=b=c=5;B.int a,b,c=5;C.int a=5,b=5,c=5;D.int a,c=b=5;
以下错误的定义语句是________。A.#define M 5; int A[M];B.int A[5,6];C.int A[][3];D.int A[10];