3 ms·
> Why should any exceptions not be checked? Because there are exceptions you can't do anything about (e.g. OutOfMemoryException) and exceptions that you don't
by incepted 11y ago
> Why should any exceptions not be checked?
Because there are exceptions you can't do anything about (e.g. OutOfMemoryException) and exceptions that you don't know what to do with (e.g. an NPE where you didn't expect it).
NPE is the poster child for an unchecked exception: if you know your code is throwing an NPE here, just fix it instead of catching the NPE.