A

Admin • 828.03K Points
Coach

Q. What is the output of the following code?

Code:
String s1 = “Hello”;
String s2 = “World”;
String s3 = s1 + s2;
System.out.println(s3);
  • (A) HelloWorld
  • (B) Hello World
  • (C) HelloWorld
  • (D) Hello_World
  • Correct Answer - Option(A)
  • Views: 19
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
The values of s1 and s2 are concatenated to form s3, which is then printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.