Answers for "how to know if certain exception is checked or unchecked"

1

how to know if certain exception is checked or unchecked

1) Look at the hierarchy, if that exception extends RuntimeException then 
it is an UNCHECKED exception
if that exception extends Exception, Throwable or 
any other Checked Exception, then it is CHECKED exception.
2) Throw it, if it compiles, it is an UNCHECKED exception, 
if not it is a CHECKED exception.
throw new SomeException();
Posted by: Guest on November-28-2020

Code answers related to "how to know if certain exception is checked or unchecked"

Browse Popular Code Answers by Language