Multiple choice technology programming languages

What is the output of following.

public static void main(String[]  args) {
    String s1="prasad";
    String s2="Ram";
    s1.concat(s2);
    System.out.println("c="+s1);
}

  1. Ram

  2. prasad

  3. RamPrasad

  4. PrasadRam

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The concat() method returns a new String object without modifying the original. Since s1.concat(s2) is not assigned to any variable, s1 remains "prasad". This demonstrates String immutability - operations that appear to modify Strings actually create new ones.