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 23?()

【参考答案】

13423

相关考题

单项选择题 class Super {  public Integer getLenght() { return new Integer(4); } }  public class Sub extends Super {  public Long GetLenght() { return new Long(5); }  public static void main(String[] args) { Super sooper = new Super();  Sub sub = new Sub();  System.out.println(  sooper.getLenght().toString() + “,” +  sub.getLenght().toString() ); } }  What is the output?()

单项选择题 1.packagefoo;2.3.importjava.util.Vector;4.5.protectedclassMyVectorVector{6.initi=1;7.publicMyVector(){8.i=2;9.}10.}11.12.publicclassMyNewVectorextendsMyVector{13.publicMyNewVector(){14.i=4;15.}16.publicstaticvoidmain(Stringargs[]){17.MyVectorv=newMyNewVector();18.}19.}Whatistheresult?()

单项选择题 public class Alpha1 {  public static void main( String[] args ) {  boolean flag; int i=0;  do {  flag = false;  System.out.println( i++ );  flag = i < 10;  continue;  } while ( (flag)? true:false );  }  }  What is the result?()

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

备案号:湘ICP备2022003000号-2