I'am sorry, I couldn't post the question before...
The question is when String s3 gets the value "EFG" and later s4 also gets the value "EFG", as the literal goes into the string pool,then s3 and s4 should point to the same reference. Then why should (s3 == s4) return false.
Only String literals go into the pool by default. You can use the intern() method for the others to enforce them to get into the pool, too.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?