Last Updated: June 6, 2026
Why does the compiler force a catch for IOException but not for NullPointerException? Both are exceptions. Both can crash a program. Yet one demands a try / catch (or a throws clause) before the code will compile, and the other passes the compiler and only fails at runtime. This lesson explains the split, why Java draws the line where it does, and how to decide which side custom exceptions belong on.