万能百科  > 所属分类  > 

给定以下JAVA代码,这段代码编译运行后输出的结果是( )publicclassTest{publicstaticintaMeth

给定以下JAVA代码,这段代码编译运行后输出的结果是( )

publicclassTest{

publicstaticintaMethod(inti)throwsException{

try{

returni/10;

}catch(Exceptionex){

thrownewException("exceptioninaaMothod");

}finally{

System.out.print("finally");

}

}

publicstaticvoidmain(String[]args){

try{

aMethod(0);

}catch(Exceptionex){

System.out.print("exceptioninmain");

}

System.out.print("finished");

}

}

A、finallyexceptioninmainfinished

B、exceptioninmainfinally

C、finallyfinished

D、finallyexceptioninmainfinished

正确答案:

C

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签