black

SCJP程序员认证考试

登录

多项选择题

1. public class A { 
2. public void method1() { 
3. B b=new B(); 
4. b.method2(); 
5. // more code here 
6. } 
7. } 
1. public class B { 
2. public void method2() { 
3.C c=new C(); 
4. c.method3(); 
5. // more code here 
6. } 
7. } 
1. public class C { 
2. public void method3() { 
3. // more code here 
4. } 
5. } 
Given: 
25. try { 
26. A a=new A(); 
27. a.method1(); 
28. } catch (Exception e) { 
29. System.out.print(”an error occurred”); 
30. } 
Which two are true if a NullPointerException is thrown on line 3 of class C?()

A. The application will crash.
B. The code on line 29 will be executed.
C. The code on line 5 of class A will execute.
D. The code on line 5 of class B will execute.
E. The exception will be propagated back to line 27.

相关考题

单项选择题 84. try {  85. ResourceConnection con = resourceFactory.getConnection();  86. Results r = con.query(”GET INFO FROM CUSTOMER”);  87. info = r.getData();  88. con.close();  89. } catch (ResourceException re) {  90. errorLog.write(re.getMessage());  91. }  92. return info;  Which is true if a ResourceException is thrown on line 86?()

单项选择题 11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?()

单项选择题 11. static classA {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B “); }  16. }  17. public static void main(String[] args) {  18.A a=new B();  19. a.process();  20.}  What is the result?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3