classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt(&quotclassNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt("forty"));}catch(RuntimeExceptionr){System.out.print("runtime");}catch(NumberFor

题目
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.编译失败


相似考题
更多“classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt(&quot ”相关问题
  • 第1题:

    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.testend

    B.Compilationfails.

    C.testruntimeend

    D.testexceptionend

    E.AThrowableisthrownbymainatruntime.


    参考答案:D

  • 第2题:

    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.end

    B.Compilationfails.

    C.exceptionend

    D.exceptiontestend

    E.AThrowableisthrownbymain.

    F.AnExceptionisthrownbymain.


    参考答案:E

  • 第3题:

    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.AC

    B.BD

    C.ACD

    D.ABCD

    E.Compilationfails.


    参考答案:C

  • 第4题:

    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.null

    B.finally

    C.nullfinally

    D.Compilationfails.

    E.finallyexception


    参考答案:E

  • 第5题:

    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.AB

    B.BC

    C.ABC

    D.BCD

    E.Compilationfails.


    参考答案:D