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.
Comments
daniel replied ago:
Article contents:
use String#equals(Object)
don't use String == String
String.intern() is cool
Did I miss anything? :-)
jwenting replied ago:
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.
Voters For This Link (4)
Voters Against This Link (8)