Greetings
I am trying to resolve a conflict in information that is appearing in a
java tutorial I am reading.
on the first page
http://chortle.ccsu.edu/Java5/Notes/chap25/ch25_17.html it says that a new
string object won't be created if the identical object already exists. Here this is described as an optimization.
on the second page
http://chortle.ccsu.edu/Java5/Notes/chap26/ch26_20.html is an example that seems to directly contradict the first statement. In this example a second object is created when an identical object already exists. I verified this by running the example, and the == operator comparing the two references returned false.
So what am I missing?