I\'ve seen many primitive examples describing how String intern()\'ing works, but I have yet to see a real-life use-case that would benefit from it.
The only situati
Not a complete answer but additional food for thought (found here):
Therefore, the primary benefit in this case is that using the
==
operator for internalized strings is a lot faster than use theequals()
method [for not internalized Strings]. So, use theintern()
method if you're going to be comparing strings more than a time or three.