Hi,
Output should be "Hello"
Because in the Constructor there is no way that the compiler can distinguish that we are talking about the class member.
So it would assign "Hello World" = "Hello World" i.e.
String = String.
And as String is initialized to be "Hello" in its declaration itself.
toString() method will use it as it is and will display "Hello" as the output.
Loveen..
Preparing for SCJP1.5