单选

下列程序的输出结果是

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

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.以上都不对
参考答案
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服