black

SCJP程序员认证考试

登录

单项选择题

public class TestString 1 { 
public static void main(String[] args) { 
String str = “420”; 
str += 42; 
System.out.print(str); 
} 
} 
What is the output?()

A. 42
B. 420
C. 462
D. 42042
E. Compilation fails.
F. An exception is thrown at runtime.

相关考题

单项选择题 1. public class Boxer1 {  2. Integer i;  3. int x;  4. public Boxer1(int y) {  5. x=i+y;  6. System.out.println(x);  7. }  8. public static void main(String[] args) {  9. new Boxer1(new Integer(4));  10. }  11. }  What is the result?()

单项选择题 10. public class ClassA {  11. public void count(int i) {  12. count(++i);  13. }  14. }  And:  20. ClassA a = new ClassA();  21. a.count(3);  Which exception or error should be thrown by the virtual machine?()

单项选择题 public class Foo {  static int[] a;  static { a[0]=2; }  public static void main( String[] args) {}  }  Which exception or error will be thrown when a programmer attempts to run this code?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064