类及其子类所表示的异常是用户程序无法处理的()
A. NumberFormatException
B. Exception
C. Error
D. RuntimeException
数组下标越界,则发生异常,提示为()
A. IOException
B. ArithmeticException
C. SQLException
D. ArrayIndexOutOfBoundsException
运行下列代码,当输入的num值为a时,系统会输出 ( )public static void main(String[] args){Scanner input = new Scanner(System.in);try{int num = input.nextInt();System.out.println("one");}catch(Exception e) {System.out.println("two");} finally {System.out.println("three");}System.out.println("end");}
A. one three end
B. two three end
C. one two three end
D. two end
运行下列代码,输出结果为 ()public static void main(String[] args){try {int a = 1-1;System.out.println("a = " + a);int b = 4 / a;int c[] = {1};c[10] = 99;} catch(ArithmeticException e) {System.out.println("除数不允许为0");} catch(ArrayIndexOutOfBoundsException e) {System.out.println("数组越界");}}
A. a = 0
B. a = 0除数不允许为0
C. a = 1数组越界
D. a = 0除数允许为0