Java Programming
Accenture Technical PrimermediumJava Programming4. Arrays And Strings

What will s2 contain after following lines of code? String s1 = one; String s2 = s1.concat(two);

Answer options

A
one
B
onetwo
C
twoone
D
two The string "two" referred by s2 is "concatenated to" the string "one" referred by s1.

Correct answer: one

Explanation

Quick AnswerThe correct answer is one because it directly addresses the core logic of Java Programming.

Correct answer: one.

Related Accenture Java Programming questions

Practice more Accenture Java Programming questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!