Java

Topic: Exceptions

How to create custom Exception?

To create you own exception extend the Exception class or any of its subclasses.e.g.
1 class New1Exception extends Exception { } // this will create Checked Exception

2 class NewException extends IOExcpetion { } // this will create Checked exception

3 class NewException extends NullPonterExcpetion { } // this will create UnChecked exception

Browse random answers: