简体   繁体   中英

In what way String Deduplication is different from String interning

As we know In Java String, process of storing and maintaining only one literal of any String is String interning. I felt String Deduplication serves the same purpose when I read it first time.

could some one explain Deduplication advantage over String intern?

String interning happens only for constant strings and strings that you manually intern.

String deduplication happens automatically in the background for all strings, including ones you create at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM