阅读下列程序片段。 Public void test(){ Try{ sayHello(); syste m.out .pri ntln("hello"); } catch (ArrayIndexOut OfBoundException e){ Syste

admin2012-12-02  62

问题 阅读下列程序片段。
Public void test(){
Try{
sayHello();
syste m.out .pri ntln("hello");

catch (ArrayIndexOut OfBoundException e){
Syste m.out .pri ntln ("ArrayIndexOut OfBoundExcep-
tion");

catch(Exception e){
Syste m.out .pri ntln("Exception");

fi nally {
Syste m.out .pri ntln("fi nally");


如果sayHello()方法正常运行,则test()方法的运行结果将是(  )。

选项 A、Hello
B、ArrayIndexOut OfBonds Exception
C、Exception   Fi nally
D、Hello Fi nally

答案D

解析 sayHello()方法正常运行则程序不抛出异常,并执行fi nally ,所以为D。
转载请注明原文地址:https://jikaoti.com/ti/o5kiFFFM
0

相关试题推荐
最新回复(0)