What is mean by Exception?
Two types of Exceptions are explained below in detail.
These exceptions are checked by the compiler at the time of compilation. Classes that extend Throwable class except Runtime exception and Error are called checked Exception.
Checked Exceptions must either declare the exception using throes keyword (or) surrounded by appropriate try/catch.
E.g. ClassNotFound Exception
These exceptions are not checked during the compile time by the compiler. The compiler doesn’t force to handle these exceptions.
- Arithmetic Exception
- ArrayIndexOutOfBounds Exception