下面程序的运行结果是()

下面程序的运行结果是()

publicclassDemo{

publicstaticvoidmain(String[]args){

try{

System.out.println(10/0);

System.out.println("除法正常运行");

}catch(ArithmeticExceptione){

System.out.println("除数不能为0");

}

}

}

A.编译失败

B.编译通过,没有结果输出

C.输出:除法正常运行

D.输出:除数不能为0

正确答案:D

猜你喜欢