Multiple choice

What is the output of the following code?

public void concatenation(){String a = Hello;a.concat(World);System.out.println(a);}

  1. Prints case Hello World

  2. Prints case World

  3. Prints case Hello

  4. Prints case World Hello

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

Since, 'a' is not assigned with the value of new concatenated string, so 'a' holds the old value itself.