当前位置:SCJP程序员认证考试题库

问题:

[单选]

What is wrong with the following code?()  
class MyException extends Exception {}  
public class Qb4ab {  
public void foo() {  try {  bar();  } finally {  baz();  
} catch (MyException e) {} 
}  
public void bar() throws MyException {  
throw new MyException(); 
}  
public void baz() throws RuntimeException {  
throw new RuntimeException(); 
 }  
}  

A . Since the method foo() does not catch the exception generated by the method baz(), it must  declare the RuntimeException in its throws clause.
B . A try block cannot be followed by both a catch and a finally block.
C . An empty catch block is not allowed.
D . A catch block cannot follow a finally block.
E . A finally block must always follow one or more catch blocks.

从现代人力资源管理的角度及农村信用社可持续发展需要看,员工福利计划可能是以下()等一项或几项的组合。 法定社会保险。 补充医疗保险。 带薪休假。 培训机会。 图像空间算法 下列哪个指标不能用来衡量债券的收益性() 即期收益率。 到期收益率。 提前赎回收益率。 债券价格波动率。 因果关系 没有实物形态的票券,利用账户通过电脑系统完成国债发行、交易及兑付的债券是() 凭证式国债。 记账式国债。 储蓄国债。 实物国债。

What is wrong with the following code?()  
class MyException extends Exception {}  
public class Qb4ab {  
public void foo() {  try {  bar();  } finally {  baz();  
} catch (MyException e) {} 
}  
public void bar() throws MyException {  
throw new MyException(); 
}  
public void baz() throws RuntimeException {  
throw new RuntimeException(); 
 }  
}  

参考答案:

  参考解析

本题暂无解析

在线 客服