Link Details

Link 19640 thumbnail
User 201848 avatar

By hanuska
via hanuska.blogspot.com
Published: Apr 23 2007 / 02:28

Comments

Add your comment
User 107114 avatar

daniel replied ago:

0 votes Vote down Vote up Reply

Article contents:

use String#equals(Object)
don't use String == String
String.intern() is cool

Did I miss anything? :-)

User 181930 avatar

jwenting replied ago:

0 votes Vote down Vote up Reply

You did get something wrong.
Nowhere does it read that String.intern() is cool. All the article says is that you should use it if you insist on using == for String comparison.
What the article misses is that you shouldn't use String.intern() unless as a last resort as using it a lot can easily lead to running out of permGen space.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.