Custom Exception in Java - tccicomputercoaching.com

Page 1

Custom Exception in Java - tccicomputercoaching.com What is Exception? Abnormal coding is called Exception. We can use Try-Catch Block to handle Exception.

There are two types of Exception handling. 1. Built in Exception i.e. ArrayoutofboundException , ArithmaticException, FilenotFoundException 2. Custom Exception Java provides us facility to create our own exceptions which are basically derived classes of Exception. Here, MyExceptionClass has been extended from derived class of Exception. Syntax: Class <MyExceptionClass> extends Exception { //statements } Syntax: throw new MyExceptionClass();


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Custom Exception in Java - tccicomputercoaching.com by Rosario Riley - Issuu