现有两个文件:Apackagex;publicclassX{publicstaticvoiddoX(),System.out.print(doX”);}和:Importx,X;classFind{publicstaticvoidmain(String[]args){XmyX=newX();myX.doX();X.doX();x.X.doX();x.XmyX2=newx.x();myX2.doX();}}结果为:()A.doXdoXdoXdoXB.Find类中出现多个错误,编译失败。C.Find类中第4行出现一个错误,编译失败。D.Find类中第5行出现一个错误,编译失败。E.Find类中第6行出现一个错误,编译失败。F.Find类中第7行出现一个错误,编译失败。
现有两个文件:Apackagex;publicclassX{publicstaticvoiddoX(),System.out.print(doX”);}和:Importx,X;classFind{publicstaticvoidmain(String[]args){XmyX=newX();myX.doX();X.doX();x.X.doX();x.XmyX2=newx.x();myX2.doX();}}结果为:()
A.doXdoXdoXdoX
B.Find类中出现多个错误,编译失败。
C.Find类中第4行出现一个错误,编译失败。
D.Find类中第5行出现一个错误,编译失败。
E.Find类中第6行出现一个错误,编译失败。
F.Find类中第7行出现一个错误,编译失败。
相关考题:
现有2个文件:1.packagex;2.publicclassX{3.publicstaticvoiddoX(){System.out.print(doXdoX);}4.}和:1.classFind{2.publicstaticvoidmain(String[]args){3.//insertcodehere4.}5.}哪两行分别插入到类Find的第3行将编译并产生输出doX”?()A.doX();B.X.doX();C.x.X.doX();D.x.XmyX=newx.X();myX.doX();
现有:classBirds{publicstaticvoidmain(String[]args){try{thrownewException();}catch(Exceptione){try{thrownewException();}catch(Exceptione2){System.out.print(inner);}System.out.print(middle);}System.out.print(outer);}}结果是()A.innerouterB.middleouterC.innermiddleouterD..编译失败
现有两个文件:packageX;publicclassX{publicstaticvoiddoX(){System.out.print(doX);}}和:importx.X;classFind{publiCstaticvoidmain(String[]args){XmyX=newX();myX.doX();X.doX();x.X.aoX():x.XmyX2=newx.X();myx2.doX();}}结果为:()A.Find类中第4行出现一个错误,编译失败。B.Find类第5行出现一个错误,编译失败。C.Find类第6行出现一个错误,编译失败。D.doXdoXdoXdoX
现有classBeverage{Beverage(){System.out.print(beverage);}}classBeerextendsBeverage{publicstaticvoidmain{string[]args){Beerb=newBeer(14);}publicintBeer(intx){this();System.out.print(beerl);}publicBeer(){System.out.print(beer2);}}结果是什么?()A.beerlbeverageB.beer2beverageC.beveragebeer2beerlD.编译失败
现有2个文件:packagex;publicclassX{publicstaticvoiddoX(){System.out.print(doX);}}和:classFind{publicstaticvoidmain(String[]args){//insertcodehere}}哪两行分别插入到类Find的第3行将编译并产生输出doX”?() A.doX();B.X.doX();C.x.X.doX();D.x.XmyX=newx.X();myX.doX();
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(C”);}finally{System.out.print(B”);}System.out.print(D”);}publicstaticvoidbadMethod(){thrownewError();}}Whatistheresult?()A.ABCDB.Compilationfails.C.Cisprintedbeforeexitingwithanerrormessage.D.BCisprintedbeforeexitingwithanerrormessage.E.BCDisprintedbeforeexitingwithanerrormessage.
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(RuntimeExceptionex){System.out.print(B”);}catch(Exceptionex1){System.out.print(C”);}finally{System.out.print(D”);}System.out.print(E”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()A.BDB.BCDC.BDED.BCDEE.ABCDEF.Compilationfails.
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()A.ABB.BCC.ABCD.BCDE.Compilationfails.
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){}}Whatistheresult?()A.ACB.BDC.ACDD.ABCDE.Compilationfails.