Q. What is the output of the following code?
Code:
String str1 = “hello”; String str2 = “world”; System.out.println(str1 + str2);
✅ Correct Answer: (A)
“helloworld”
Explanation: The two String variables str1 and str2 are concatenated using the + operator, which results in the combined string “helloworld”.