Java Virtual Machine maintains an internal list of references for interned Strings ( pool of unique Strings) to avoid duplicate String objects in heap memory. Whenever the JVM loads String literal from class file and executes, it checks whether that String exists in the internal list or not. If it already exists in the list, then it …
Tag Archive: java string
Permanent link to this article: http://www.javaplex.com/blog/inside-string-working-in-jvm/