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

问题:

[多选]

Class TestException 
1. public class TestException extends Exception { 
2. } Class a: 
1. public class a { 
2. 
3. public String sayHello(String name) throws TestException { 
4. 
5. if(name == null) { 
6. throw new TestException(); 
7. } 
8. 
9. return “Hello “+ name; 
10. } 
11. 
12. } 
A programmer wants to use this code in an application:
45. A a=new A(); 
46. System.out.println(a.sayHello(”John”)); 
Which two are true?()

A .  Class a will not compile.
B .  Line 46 can throw the unchecked exception TestException.
C .  Line 45 can throw the unchecked exception TestException.
D .  Line 46 will compile if the enclosing method throws a TestException.
E .  Line 46 will compile if enclosed in a try block, where TestException is caught.

组织论是一门学科,是与项目管理学相关的一门非常重要的基础理论学科,它主要研究系统的()。 技术流程组织。 合同关系。 组织结构模式。 组织目标。 组织分工。 地球附近的大气中,氧气约占() 21%。 50%。 30%。 下列文献记载,体现中国传统类比思维模式的是() “天地与我并生,而万物与我为一。”。 “上下与天地同流。”。 “圣人抱一以为天下式。”。 “方以类聚,物以群分,吉凶生矣。&rdquo。 东汉尚书台的结构有哪些? 楼梯的建筑构造要求中,疏散用楼梯和疏散通道上的阶梯不宜采用螺旋楼梯和扇形踏步。当必须采用时,踏步上下两级所形成的平面角度不应大于10°,且每级离扶手25cm处的踏步深度不应小于()cm。 12。 22。 32。 42。

Class TestException 
1. public class TestException extends Exception { 
2. } Class a: 
1. public class a { 
2. 
3. public String sayHello(String name) throws TestException { 
4. 
5. if(name == null) { 
6. throw new TestException(); 
7. } 
8. 
9. return “Hello “+ name; 
10. } 
11. 
12. } 
A programmer wants to use this code in an application:
45. A a=new A(); 
46. System.out.println(a.sayHello(”John”)); 
Which two are true?()

参考答案:

  参考解析

本题暂无解析

在线 客服