PrepZone Logo
PrepZone
Back to Java

Java · Medium

What is the String pool? How does String.intern() work? What are the memory implications?

JavaCore JavaStringsJVM

Answer preview

The String pool (string intern pool) is a special area in the JVM heap where literal strings and interned strings are stored, enabling reference equality for identical content.…