black

SCJP程序员认证考试

登录

填空题

1. public class test { 
2. public static string output = “” 
3.   
4. public static void foo(int i) { 
5. try { 
6. if(i= =1) { 
7. throw new Exception (); 
8. } 
9. output += “1”; 
10.} 
11. catch(Exception e)  { 
12. output += “2”; 
13. return; 
14.} 
15. finally ( 
16. output += “3”; 
17. ) 
18. output += “4”; 
19. }
20.   
21. public static void main (string args[])  ( 
22. foo(0); 
23. foo(1); 
24.   
25. ) 
26. }
What is the value of the variable output at line 24?()

【参考答案】

13423

相关考题

单项选择题 import java.io.IOException;  public class ExceptionTest(  public static void main (String[]args)  try (  methodA();  ) catch (IOException e)  (  system.out.printIn(“Caught IOException”);  ) catch (Exception e)   (  system.out.printIn(“Caught Exception”);  )  )  public void methodA ()   {  throw new IOException ();  }   What is the result?()

单项选择题 public class foo {  public static void main (string[]args)  try {return;}  finally {system.out.printIn(“Finally”);}  }  What is the result?()

多项选择题 switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3