Q. What is the output of the following code snippet?

Code:
String s1 = “Hello”;
String s2 = “World”;
System.out.println(sA)concat(s2));
  • (A) HelloWorld
  • (B) Hello World
  • (C) Error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) HelloWorld
Explanation: The concat method in Java concatenates two strings together. In this case, sA)concat(s2)
Explanation by: Kirti
The concat method in Java concatenates two strings together. In this case, sA)concat(s2)

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
195
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Kirti
Publisher
πŸ“ˆ
99%
Success Rate