How many string objects will the JVM version 1.6 create

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.

+5
source share
1 answer

I think one of the two should help determine how many objects were created.

+1
source

All Articles