Java Puzzlers, Strange Loop Edition
summary
Forty-five minutes of five concrete Java puzzlers with working code, surprising outputs and fixes: a hash table contains looks at values not keys bug that makes the program print 0, a serialization proxy that throws ClassCastException unless the proxy is static nested (fails with circular refs), enum class‑init circularity that produces a null and a NullPointerException, a var‑arg/Double.MIN_VALUE pitfall that prints 4.9e‑324, and hex literal/short quirks; each puzzle shows the failing program, the exception or wrong number, and the minimal fix.
AI-written summary · about








