计算机二级在线答题

Java每日一练(2017/12/20):请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是()。

2017年12月20日来源:计算机二级考试 所有评论

每日一练:计算机二级考试Java每日一练(2017/12/20)
【单选题】请阅读下列程序代码,然后将程序的执行结果补充完整。横线处应填写的内容是(      )。 
程序代码: 
public class throwsExeeption{
static void Proc(intsel)
throws Arithmetic Exception,Array Index Out Of
Bounds Exception{
System.out.println("InSituation"+sel); 
if(sel= =0){
System.OUt.println("noException caught"); 
return; 
}
else if(sel= =l){
int iArray[]=newint[4]; 
iArray[1]=3; 
}
}
public static void main(String args[]){
try{
Proe(O); 
Proc(1); 
}
catch(Array Index Out Of Bounds Exception e){
System.out.println("Catch"+e); 
}
finally{
System.out.println("inProcfinally"): 
}
}
}
执行结果: 
In Situation 0
no Exception caught
in Proc finally
A.In Situation l 
B.In Situation
C.with Catch 
D.int iArray l
在下面提交答题后即可查看答案与试题解析

发布评论 查看全部评论

相关推荐