The Evolution of the Java Memory Architecture
Note: Before we get started, you might want to take a look at another post of mine. It explains the core concepts of the Java Memory Architecture, the ones that should get you started to understand this evolution better.
String Literals in Java are stored in a String Pool. String Interning refers to a process or method by which only one copy of a specific string is stored in memory. This is done to allow the efficient usage of memory while also taking less time to retrieve, except when the string is first created. This immutable single copy of the String is called an intern. Java provides a method in the String class, intern(), to actually create/retrieve this copy of the string.
via DZone.com Feed https://dzone.com
May 22, 2017 at 05:39PM