classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt(forty));}catch(RuntimeExceptionr){System.out.print(runtime);}catch(NumberFormatExceptione){System.out.print(number);}}}结果是什么?()A.fortyB.numberC.runtimeD.编译失败

classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt("

classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt("forty"));}catch(RuntimeExceptionr){System.out.print("runtime");}catch(NumberFormatExceptione){System.out.print("number");}}}结果是什么?()

A.forty

B.number

C.runtime

D.编译失败


相关考题:

classThreadExceptimplementsRunnable{publicvoidrun(){thrownewRuntimeException(exception);}publicstaticvoidmain(String[]args){newThread(newThreadExcept()).start();try{intx=Integer.parseInt(args[0]);Thread.sleep(x);System.out.print(main);}catch(Exceptione){}}}和命令行:javaThreadExcept1000哪一个是结果?()A.mainB.编译失败C.代码运行,但没有输出D.mainjava.lang.RuntimeException:exception

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.innerB.innerouterC.middleouterD.innermiddleouter

现有: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..编译失败

现有:classNumber{publicstaticvoidmain(String[]aras){try{System.out.print(Integer.parselnt(forty));}catch(RuntimeExceptionr){System.out.print(runtime);}catch(NumberFormatExceptione){system..ut.print(number);}}}结果是什么?()A.numberB.runtimeC.fortynumberD.编译失败

staticvoidtest()throwsRuntimeException{try{System.out.print(”test);thrownewRuntimeException();}catch(Exceptionex){System.out.print(”exception);}}publicstaticvoidmain(String[]args){try{test();}catch(RuntimeExceptionex){System.out.print(”runtime);}System.out.print(”end);}Whatistheresult?()A.testendB.Compilationfails.C.testruntimeendD.testexceptionendE.AThrowableisthrownbymainatruntime.

staticvoidtest(){try{Stringx=null;System.out.print(x.toString()+);}finally{System.out.print(finally);}}publicstaticvoidmain(String[]args){try{test();}catch(Exceptionex){System.out.print(”exception);}}Whatistheresult?()A.nullB.finallyC.nullfinallyD.Compilationfails.E.finallyexception

staticvoidtest()throwsError{if(true)thrownewAssertionError();System.out.print(”test);}publicstaticvoidmain(String[]args){try{test();}catch(Exceptionex){System.out.print(”exception);}System.out.print(”elld);}Whatistheresult?()A.endB.Compilationfails.C.exceptionendD.exceptiontestendE.AThrowableisthrownbymain.F.AnExceptionisthrownbymain.

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.