beginnerPremium

String Pool

Why identical strings can share one object

String Pool

String literals are interned in a pool. new String() always creates a separate heap object.

The narrated version of this skribble — tap play for the full-size video.

1:31

String Pool

Premium
🔒

Premium skribble

The preview above is intentionally blurred. Unlock the full-resolution skribble — and its deep-dive board — with TechSkribble.

Unlock this course Already purchased? Sign in
#java#strings#memory