How many types of exception?
There are two types of exception:
- Checked Exception: All the exception other than Runtime exceptions and error are knowns as checked exception. It will be checked by compiler and thrown at the compiler time. There are some common checked exception like SQL exception, FileNotFoundException and IOException
- Unchecked exception or Runtime exception: Unchecked exception won’t be checked by compiler and it will be thrown at the runtime. There are some common runtime exception like NullPointerException, ArrayIndexOutOfBoundException or ArithmethicException