搜题
问题   更新时间2023/4/3 12:59:00

以下程序运行结果是( )

public class Ex20 {

public int div(int a, int b) {

try {

return a / b;

}catch (ArithmeticException e) {

System.out.print(" ArithmeticException ");

}catch(Exception e){

System.out.print(" Exception");

} finally {

System.out.print("finally");

}

return 0;

}

public static void main(String[] args) {

Ex20 demo = new Ex20();

System.out.print(" 商是:" + demo.div(9, 0));

}

}
A
Exception finally 商是:0
B
ArithmeticException finally 商是:0
C
finally商是:0
D
编译报错

王老师:19139051760(拨打)