填空题
请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsException{
static void Proc(int sel)
throws ArithmeticException, ArrayIndexOutOfBoundsException
System.out.println("In Situation"+sel);
if(sel==0){
System.out.println("no Exception caught");
return;
}
else if(sel==1){
int iArray[]=new int[4];
iArray[1]=3;
}
}
public static void main(String args[]){
try{
Proc(0);
Proc(1);
}
catch (ArrayIndexOutOfBoundsException e){
System.out.println("Catch"+e);
}
finally{
System.out.println("in Proc finally");
}
}
}
执行结果
In Situation 0
no Exception caught
______
in Proc finally
【参考答案】
In Situationl[解析] 本题考查考生阅读Java程序的能力。题目程序看似复杂,但流程非常简单。程序的publ......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)