What will be the output of the following code?

Last Updated :
Discuss
Comments

What will be the output of the following code?

Java
String s1 = "Java";
String s2 = s1.concat(" Programming");
System.out.println(s1);

Java

Java Programming


Compilation Error

Runtime Exception

Share your thoughts in the comments