网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
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;}
热门标签
最新试卷