下面代码运行结果是那个
public class Demo{
public int add(int a,int b){
try{
return a+b;
}catch(Exception e){
System.out.println(“catch 语句块”);
}finally{
System.out.println(“finally 语句块”);
}
return 0;
}
public static void main(String[] args){
Demo demo = new Demo();
System.out.println(“和是:”+demo.add(9,34));
}
}
A) 编译异常
B) finally语句块 和是:43
C) 和是:43 finally语句块
D) catch语句块 和是:43
|
|