单选题 Java
题号 #3633509

请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是(  )。
程序代码:

执行结果:
In Situation 0
no Exception caught
in Proc finally

进入在线模考

参考答案

A

答案解析

本题考查考生阅读Java 程序的能力。题目程序看似复杂,但流程非常简单。程序的public 类是throws Exception ,类中定义了Proc(intsel)方法。程序入口是main()方法,使用try -catch -finally 来捕获ArithmeticException和ArrayIndexOutOfBounds Exception 异常,这两个异常是关于算术异常或数组索引越界的异常。执行Proc(0)时,输出In Situation0和no Exception caught 两条信息;执行Proc(1)时,输出In Situation1和in Proc finally 两条信息。整个程序并未发生异常。

你可能感兴趣的试题

A.Error
B.VirtuaMachineError
C.Exception
D.Thread
A.printMessage
B.getMessage
C.toString
D.fillStackTrace
找试题 · 找答案 · 找资料 在线模考