black

SCJP程序员认证考试

登录

单项选择题

1. class Exc0 extends Exception { } 
2. class Exc1 extends Exc0 { } 
3. public class Test { 
4. public static void main(String args[]) { 
5. try { 
6. throw new Exc1(); 
7. } catch (Exc0 e0) { 
8. System.out.println(“Ex0 caught”); 
9. } catch (Exception e) { 
10. System.out.println(“exception caught”); 
11. } 
12. } 
13. } 
What is the result?()  

A. Ex0 caught
B. exception caught
C. Compilation fails because of an error at line 2.
D. Compilation fails because of an error at line 6.

相关考题

单项选择题 Youwantsubclassesinanypackagetohaveaccesstomembersofasuperclass.Whichisthemostrestrictiveaccessthataccomplishesthisobjective?()

单项选择题 public class X {  public static void main(String [] args) {  try {  badMethod();  System.out.print(“A”);  }  catch (Exception ex) {  System.out.print(“C”);  }  finally {  System.out.print(“B”);  }  System.out.print(“D”);  }  public static void badMethod() {  throw new Error();  }  }  What is the result?()

多项选择题 public class X {  public X aMethod() { return this;}  }  public class Y extends X {  }  Which two methods can be added to the definition of class Y?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2