String s = "abc";
This statement creates the object in String pool & returns the reference.
String s = new String("abc");
This statement creates the object in Heap & returns the reference.
after above statements, now if you do
String s1 = "abc";
the reference of "abc" already existing in String pool is returned.
String s2 = new String("abc");
This will create new object & returns the refernce.
