classA{A(){}}classBextendsA{}Whichtwostatementsaretrue?() A.ClassB’sconstructorispublic.B.ClassB’sconstructorhasnoarguments.C.ClassB’sconstructorincludesacalltothis().D.ClassB’sconstructorincludesacalltosuper().

classA{A(){}}classBextendsA{}Whichtwostatementsaretrue?()

A.ClassB’sconstructorispublic.

B.ClassB’sconstructorhasnoarguments.

C.ClassB’sconstructorincludesacalltothis().

D.ClassB’sconstructorincludesacalltosuper().


相关考题:

给出下列代码,可放在类A的横线位置作为A合理的内部类的是( )。 class A { protected int i; A(int i) { this.i = i; } ______ }A.class B { }B.class B extends A { }C.class B implements A { }D.class A { }

给出下列的程序段,则哪个选项是类A合理的内部类? ( ) class A{ protected int i; A(int i){ this.i=i;A.classB { }B.class B extendsA { }C.class B extends A{ B(){System.out.println("i="+1);} }D.class A { }

现有:classA{publicStringname=a}classBextendsA{publicStringname=b}执行如下代码后的结果是哪项?()Aa=newB();System.out.println(a.name); A.aB.bC.编译失败D.运行时抛出异常

Whichstatementsconcerningthefollowingcodearetrue?()classa{publica(){}publica(inti){this();}}classbextendsa{publicbooleanb(Stringmsg){returnfalse;}}classcextendsb{privatec(){super();}publicc(Stringmsg){this();}publicc(inti){}}A.Thecodewillfailtocompile.B.Theconstructorinathattakesanintasanargumentwillneverbecalledasaresultofconstructingan objectofclassborc.C.Classchasthreeconstructors.D.Objectsofclassbcannotbeconstructed.E.Atmostoneoftheconstructorsofeachclassiscalledasaresultofconstructinganobjectofclassc.

classA{publicA(){System.out.println(hellofroma”);}}classBextendsA{publicB(){System.out.println(hellofromb”);super();}}publicclassTest{publicstaticvoidmain(Stringargs[]){Aa=newB();}}Whatistheresultwhenmainisexecuted?()A.Compilationfails.B.hellofromaC.hellofrombD.hellofrombhellofromaE.hellofromahellofromb

classA{publicbytegetNumber(){return1;}}classBextendsA{publicshortgetNumber(){return2;}publicstaticvoidmain(Stringargs[]){Bb=newB();System.out.println(b.getNumber());}}Whatistheresult?() A.1B.2C.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerrorinline8.E.Compilationfailsbecauseofanerrorinline14.

Whatproducesacompilererror?() A.classA{publicA(intx){}}B.classA{}classBextendsA{B(){}}C.classA{A(){}}classB{publicB(){}}D.classZ{publicZ(int){}}classAextendsZ{}

给出下列的代码,则下列选项中哪个是类A合理的内部类? class A { protected int i; A(int i) { this.i=i; } }A.class B { }B.class B extends A { }C.class B extends A { B( ){System.out.println("="+i);} }D.class A { }

给出—卜列的代码,则下列选项中( )可以表示为类A合理的内部类。 class A{ protected int i; A (int i) { this i=i; }}A.class B{ }B.class B extends A{ }C.class B extends A{ B ( ){System.out.println("i="+i);} }D.class A{ }