[SOLVED] 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.

Answered By – Louis Wasserman

Answer Checked By – Robin (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *