Multiple choice technology programming languages

String s = "India";String s2 = s;s.concat (” is a nation.”);System.out.println(s);

  1. India

  2. India is a nation.

  3. is a nation.

  4. None of the above.

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

The concat() method returns a new String but doesn't modify the original. Since the result of s.concat() is not assigned to any variable, s remains unchanged. The output prints the original value "India". This demonstrates String immutability in action.