black

SCJP程序员认证考试

登录

单项选择题

public static void main(String[] args) { 
String str = “null‟; 
if (str == null) { 
System.out.println(”null”); 
} else (str.length() == 0) { 
System.out.println(”zero”); 
} else { 
System.out.println(”some”); 
} 
} 
What is the result?()

A. null
B. zero
C. some
D. Compilation fails.
E. An exception is thrown at runtime.

相关考题

单项选择题 11. public static void main(String[] args) {  12. Integer i = uew Integer(1) + new Integer(2);  13. switch(i) {  14. case 3: System.out.println(”three”); break;  15. default: System.out.println(”other”); break;  16. }  17. }  What is the result?()

单项选择题 11. public void testIfA() {  12. if(testIfB(”True”)) {  13. System.out.println(”True”);  14. } else {  15. System.out.println(”Not true”);  16. }  17. }  18. public Boolean testIfB(String str) {  19. return Boolean.valueOf(str);  20. }  What is the result when method testIfA is invoked?()

单项选择题 public class Test {  public enum Dogs {collie, harrier};  public static void main(String [] args) {  Dogs myDog = Dogs.collie;  switch (myDog) {  case collie:  System.out.print(”collie “); case harrier:  System.out.print(”harrier “);  }  }  }  What is the result?()

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

备案号:湘ICP备2020024380号-3