Blogger

Delete comment from: Javarevisited

String class is not a common class. It has a specific requirements and it is handled as special by both JVM Specification and Java Language Specification. Many language features depend on ability of String to represent constant text - some of them mentioned above.

One of the "side effect" of String immutability is an ability to cache its hash value which greatly improves String performance in hash based collections.

Jan 21, 2011, 11:34:14 PM


Posted to Why String is Immutable or Final in Java? Explained

Google apps
Main menu