一、选择
1.下列代码中的异常属于(多选) (A D)
int a = 0;
System.out.println(2/a);
A. 非检查型异常
B. 检查型异常
C. Error
D. Exception
2.类及其子类所表示的异常是用户程序无法处理的 (C)
A. NumberFormatException
B. Exception
C. Error
D. RuntimeException
3.数组下标越界,则发生异常,提示为 (D)
A. IOException
B. ArithmeticException
C. SQLException
D. ArrayIndexOutOfBoundsException
4.运行下列代码,当输入的num值为a时,系统会输出 (B)
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