classSuper{2.publicfloatgetNum(){return3.0f;}3.}4.5.publicclassSubextendsSuper{6.7.}Whichmethod,placedatline6,causescompilationtofail?() A.publicvoidgetNum(){}B.publicvoidgetNum(doubled){}C.publicfloatgetNum(){return4.0f;}D.publicdoublegetNum(floatd){return4.0d;}

classSuper{2.publicfloatgetNum(){return3.0f;}3.}4.5.publicclassSubextendsSuper{6.7.}Whichmethod,placedatline6,causescompilationtofail?()

A.publicvoidgetNum(){}

B.publicvoidgetNum(doubled){}

C.publicfloatgetNum(){return4.0f;}

D.publicdoublegetNum(floatd){return4.0d;}


相关考题:

1.classA{2.publicintgetNumber(inta){3.returna+1;4.}5.}6.7.classBextendsA{8.publicintgetNumber(inta){9.returna+210.}11.12.publicstaticvoidmain(Stringargs[]){13.Aa=newB();14.System.out.printIn(a.getNumber(0));15.}16.}Whatistheresult?()A.Compilationsucceedsand1isprinted.B.Compilationsucceedsand2isprinted.C.Anerroratline8causescompilationtofail.D.Anerroratline13causescompilationtofail.E.Anerroratline14causescompilationtofail.

classsuper{2.publicfloatgetNum(){return3.0f;}3.}4.5.publicclassSubextendsSuper{6.7.}Whichmethod,placedatline6,willcauseacompilererror?() A.PublicfloatgetNum(){return4.0f;}B.PublicvoidgetNum(){}C.PublicvoidgetNum(doubled){}D.PublicdoublegetNum(floatd){retrun4.0f;}

abstractclassabstrctIt{abstractfloatgetFloat();}publicclassAbstractTestextendsAbstractIt{privatefloatf1=1.0f;privatefloatgetFloat(){returnf1;}}Whatistheresult?() A.Compilationissuccessful.B.Anerroronline6causesaruntimefailure.C.Anerroratline6causescompilationtofail.D.Anerroratline2causescompilationtofail.

interfacefoo{2.intk=0;3.}4.5.publicclasstestimplementsFoo(6.publicstaticvoidmain(Stringargs[])(7.inti;8.Testtest=newtest();9.i=test.k;10.i=Test.k;11.i=Foo.k;12.)13.)14.Whatistheresult?() A.Compilationsucceeds.B.Anerroratline2causescompilationtofail.C.Anerroratline9causescompilationtofail.D.Anerroratline10causescompilationtofail.E.Anerroratline11causescompilationtofail.

publicclasstest(2.publicstaticvoidmain(Stringargs[]){3.inti=0xFFFFFFF1;4.intj=~i;5.6.}7.)Whatisthedecimalvalueofjatline5?() A.0B.1C.14D.–15E.Anerroratline3causescompilationtofail.F.Anerroratline4causescompilationtofail.

classA{publicStringtoString(){return4”;}}classBextendsA{8.publicStringtoString(){returnsuper.toString()+3”;}}publicclassTest{publicstaticvoidmain(Stringargs){System.out.printIn(newB());}}Whatistheresult?()A.Compilationsucceedsand4isprinted.B.Compilationsucceedsand43isprinted.C.Anerroronline9causescompilationtofail.D.Anerroronline14causescompilationtofail.E.Compilationsucceedsbutanexceptionisthrownatline9.

publicclassX{publicstaticvoidmain(Stringargs){inta=newint[1]modify(a);System.out.printIn(a[0]);}publicstaticvoidmodify(inta){a[0]++;}}Whatistheresult?() A.Theprogramrunsandprints“0”B.Theprogramrunsandprints“1”C.Theprogramrunsbutabortswithanexception.D.Anerror“possibleundefinedvariable”atline4causescompilationtofail.E.Anerror“possibleundefinedvariable”atline9causescompilationtofail.

classA{publicintgetNumber(inta){returna+1;}}classBextendsA{publicintgetNumber(inta){returna+2}publicstaticvoidmain(Stringargs){Aa=newB();System.out.printIn(a.getNumber(0));}}Whatistheresult?() A.Compilationsucceedsand1isprinted.B.Compilationsucceedsand2isprinted.C.Anerroratline8causescompilationtofail.D.Anerroratline13causescompilationtofail.E.Anerroratline14causescompilationtofail.

classsuper{publicfloatgetNum(){return3.0f;}}publicclassSubextendsSuper{}Whichmethod,placedatline6,willcauseacompilererror?() A.PublicfloatgetNum(){return4.0f;}B.PublicvoidgetNum(){}C.PublicvoidgetNum(doubled){}D.PublicdoublegetNum(floatd){retrun4.0f;}