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

Integer cache

The shared Integer objects for -128 to 127 that boxing reuses instead of allocating.

Integer.valueOf (and autoboxing) returns cached instances for -128 to 127, as do Short, Byte and Long; Character caches 0 to 127. == on boxes seems to work inside the range and fails outside it.

Read the full section →