Possible Duplicate:
Java String Pool Questions
I recently read a java article and found the following statement: "Improved string merging technology in java 6 onward." One of the examples they mentioned as follows
String one = "one";
String two = new String("one");
The number of objects created by the above example is = 1
Here I am a little confused, although we use the keyword newbecause it does not create a new object and does not use the object created in the row pool.
Please clarify me.
source
share