The output of the given code will be:
onenine
When you concatenate str1
("one") and str2
("nine") using the +
operator, the result is the string "onenine". The System.out.print
statement then prints that result to the screen. Therefore, the correct answer is onenine
.