正在加载图片...
Interned Strings Since strings are immutable and are frequentl used, to improve efficiency and save memory, the JVM uses a unique instance for string literals with the same character sequence. Such an instance is called interned. You can also use a string objects intern method to return an interned string For example, the following statements Liang, Introduction to Java Programming, Sixth Edition, (c)2005 Pearson Education, Inc. All rights reserved. 0-13-148952-6Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved. 0-13-148952-6 9 Interned Strings Since strings are immutable and are frequently used, to improve efficiency and save memory, the JVM uses a unique instance for string literals with the same character sequence. Such an instance is called interned. You can also use a String object’s intern method to return an interned string. For example, the following statements:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有