![]() ![]() This process is called String Interning.Since the JVM can only intern Compile Time String Constants, we can manually call the intern() method on strings we intend to intern. ![]() ![]() In order to save some heap space, we can store one version of each String and make others refer to the stored version. If a large number of those strings contain the same content, then a significant part of the heap will be wasted. Because of their ubiquity, they usually occupy a large portion of the Heap. Let's start with Strings, one of the most commonly used data types in application and library code. ![]()
0 Comments
Leave a Reply. |