多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

11.classa {  12. public void process() { System.out.print(”a,”); } }  13. class b extends a {  14. public void process() throws IOException {  15. super.process();  16. System.out.print(”b,”);  17. throw new IOException();  18. } }  19. public static void main(String[] args) {  20. try { new b().process(); }  21. catch (IOException e) { System.out.println(”Exception”); } }  What is the result?() 

  • A、 Exception
  • B、 a,b,Exception
  • C、 Compilation fails because of an error in line 20.
  • D、 Compilation fails because of an error in line 14.
  • E、 A NullPointerException is thrown at runtime.
正确答案:D
答案解析:
进入题库查看解析

微信扫一扫手机做题