What does <code>"" + 1 + 2 + 3</code> produce?
- A
Compile error
- B
6
- Ccheck_circle
123
- D
1.2.3
Explanation
Empty string forces concatenation; result is "123".
AP Computer Science A· difficulty 3/5
What does <code>"" + 1 + 2 + 3</code> produce?
Compile error
6
123
1.2.3
Explanation
Empty string forces concatenation; result is "123".
Want 10 more like this — adaptive to your weak spots?
<code"score: " + obj</code where obj is null prints…
chevron_rightConsider: <code class="language-java"String a = "hi"; String b = "hi"; String c = new String("hi"); String d = a + ""; boolean p = (a == b); boolean q = (a == c…
chevron_rightWhat is wrong?…
chevron_right