String s1 = "Hello";
String s2 = "Hello";
String s3 = new String("Hello");
String s4 = new String ("Hello");
s1 and s2 point the same object (object A).
s3 and s4 point 2 different objects.
Does s3 point the same object as s1 and s2 (object A)?
--------------------------------------------------
If the order was different:
String s3 = new String("Hello");
String s4 = new String ("Hello");
String s1 = "Hello";
String s2 = "Hello";
Again s3 and s4 point 2 different objects (object A and object B respectively).
And s1 and s2 point same string object, but which object are s1 and s2 pointing at? A or B?
Many thanks!
Stasha
