單項(xiàng)選擇題

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.

題目列表

你可能感興趣的試題

微信掃碼免費(fèi)搜題