Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

string pool

The shared store that lets equal string literals be one object.

The JVM's table of interned strings; identical literals and compile-time constant expressions refer to one pooled object, which is why == sometimes appears to work for strings.

Examples

  • "yes" == "yes" is true for two literals, but text read from input is a new object, so compare with equals.

See also

Read the full section →