单选题 Java
题号 #2243899

阅读下列程序片段。
Public void test(){
Try{
sayHello();
system.out.println("hello"):
}catch(ArraylndexOutOfBoundException e){
System.out.println("ArraylndexOutOfBoundExcep—
tion");
}catch(Exception e){
System.out.println("Exception"):
}finally{
System.Out.println("finally");
}
} 
如果sayHello()方法正常运行,则test()方法的运行结果将是(  )。

进入在线模考

参考答案

D

答案解析

D。【解析】sayHello()方法正常运行则程序不抛出异常,并执行finally,所以为D。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考