Hi All,
1. String s="abc";
2. String s1=new String("world");
In SCJP(v 1.4) book by KathySierra chapter no. 6 Java.lang -The Math class,Strings, and Wrappers :
For the statement at line 1 ,its represented diagramatically that a String object with value "abc" gets created on heap and refers s to it.In the statement at line 1 "new String()" is not used then how come String object
gets created on heap.I feel that it just creates the String object in String Constant Pool if compiler doesn't find the literal "abc" in String Constant Pool.Where is this String Constant pool? whether this pool is a part of heap or is totally a different thing and is located somewhere else?
With this confusion my String basic concepts are getting disturbed.Pls explain???