How many
String objects are created when we run the following code.
String s1,s2,s3,s4;
s1 = "Hello";
s2 = s1;
s3 = s2 + "Pal";
s4 = s3;
Ans is 3
My ans is 2
According objects will be created as follows
s1=s2-->"Hello"
-->"Pal" (Lost)
s3=s4-->"HelloPal"
Does lost object "Pal" will count.