单项选择题
String a = null;
a.concat(“abc”);
a.concat(“def”);
System.out.println(a);
What is the result?()
A. abc
B. null
C. abcdef
D. Compilation fails.
E. The code runs with no output.
F. An exception is thrown at runtime.
点击查看答案&解析
相关考题
-
多项选择题
public static void main( String[] args ) { Integer a = new Integer(10); Integer b = new Integer(10); Integer c = a; int d = 10; double e = 10.0; } Which three evaluate to true?()
A. (a == c)
B. (d == e)
C. (b == d)
D. (a == b)
E. (b == c)
F. (d == 10.0) -
单项选择题
public class Test { public static void add3 (Integer i) { int val = i.intValue(); val += 3; i = new Integer(val); } public static void main(String args[]) { Integer i = new Integer(0); add3(i); System.out.println(i.intValue()); } } What is the result? ()
A. 0
B. 3
C. Compilation fails.
D. An exception is thrown at runtime. -
单项选择题
int i = 0, j = 1; if ((i++ == 1) && (j++ == 2)) { i = 42; } System.out.println(“i = “ + i + “, j = “ + j); What is the result?()
A. i = 1, j = 2
B. i = 1, j = 1
C. i = 42, j = 2
D. i = 42, j = 1
E. Compilation fails.
