πŸ“Š JAVA
Q. What is the output of the following code snippet?
Code:
String s1 = “Hello”;
String s2 = “World”;
System.out.println(s1 + s2);
  • (A) HelloWorld
  • (B) Hello World
  • (C) Error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) HelloWorld

Explanation: In Java, the + operator can be used to concatenate two strings. In this case, s1 + s2 returns “HelloWorld”.

Explanation by: Kirti
In Java, the + operator can be used to concatenate two strings. In this case, s1 + s2 returns “HelloWorld”.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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