万能百科  > 计算机   > 

[问答题] 下列程序的输出结果是  public class Test{  public static void main(String[] args){  i

2021-07-20   

[问答题] 下列程序的输出结果是  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");  }  }

正确答案:

-1

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签