首页 > 职业考试题库1 > 题目详情
下面程序的输出结果是public class Test{ public stat
题目内容:
[单选题]下面程序的输出结果是 public class Test{ public static void main(String[] args){ int[]array={2,4,6,8,10}; int size=6; int result=-1: try{ for(int i=0;i<size&&result==-1;i++) if(array[i]==20)result=i; }catch(ArithmeticException e){ System.out.println("Catch---1"); }catch(ArrayIndexOutOfBoundsException e){ System.out.println("Catch---2"); }catch(Exception e){ System.out.println("Catch---3"); } } }
A.Catch---1
B.Catch一--2
C.Catch---3
D.以下都不对
本题链接: