If I declare class
Class MyOwnException extends Exception
{
}
Is this is a checked or unchecked exception?
If you extend Exception then it is "checked", i.e if you throw it, it must be caught or declared in the method signature.
Unchecked exceptions extend RuntimeException and do not need to be declared or caught. It is also possible to create an unchecked exception by extending Error or one of its subclasses, but these exceptions are by convention reserved for use by the JDK.
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