Given:
String s = new String(“3”);
System.out.print(1 + 2 + s + 4 + 5);
What is the result?
A.
12345
B.
3345
C.
1239
D.
339
E.
Compilation fails.
Explanation:
1 and 2 are added.
Then the string s is concatenated.
Finally 3 and 4 are concatenated as strings.
correct, if s is a String builder compilation failed please keep this point in mind
B