• 2022-06-08 问题

    下列程序的输出结果是______。 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 & & resuIt==-1;) if(array[i]==20)result=i; catch(ArithmeticException e) System. out. println("Catch---1"); catch(ArrayIndexOutofBoLmdsException e) System. out. println("Catch---2"); catch(Exception e) System. out. println("Catch---3");[/i] A: Catch---1 B: Catch---2 C: Catch---3 D: 以上都不对

    下列程序的输出结果是______。 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 & & resuIt==-1;) if(array[i]==20)result=i; catch(ArithmeticException e) System. out. println("Catch---1"); catch(ArrayIndexOutofBoLmdsException e) System. out. println("Catch---2"); catch(Exception e) System. out. println("Catch---3");[/i] A: Catch---1 B: Catch---2 C: Catch---3 D: 以上都不对

  • 1