Is it possible to tell if an exception class is a checked or unchecked just by looking at the code? I always thought that if it extended Exception, it was checked, but then RuntimeException extends Exception and that is unchecked. RuntimeException may be the only class that bends that rule of thumb, with other unchecked exceptions having to extend Throwable if not extending RuntimeException. However, I do not see how RuntimeException differs from Exception. I wonder if the difference is defined inside the interpreter itself?
RuntimeException
and its subclasses are unchecked exceptions. All others are checked exceptions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With