String Interning
String interning is a mechanism where identical string values can share a single canonical instance. In Java, string literals are placed in the string pool, and explicit interning can request the canonical pooled representation. This can reduce duplicate string objects.
Interning can reduce memory usage when the same strings occur repeatedly.
It can make identity comparisons meaningful for interned references, although content comparison should normally use equals().
Interning has overhead, so it should not be applied indiscriminately to high-cardinality data.
Immutable strings are important because shared instances must not be modifiable.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience