should beIn fact, when you do new String("hello"); two String objects are created - one in the string
pool because of the use of a quoted string, and one in the regular heap space because of the use of
new keyword.
?In fact, when you do new String("hello"); two String objects, at most, are created - if it does not already exist, one in the string
pool because of the use of a quoted string, and one in the regular heap space because of the use of the new keyword.
Thus, there should only be one "hello" in the string pool and 2 "hello" String objects after the first (7 lined) example. Correct? If not, why not?