Exception in java is an error event that can happen during the execution of a program and disrupts its normal flow. When an exception occurs during the program execution then
program execution gets terminated and does no’t continue further. if we want to avoid abnormal termination of program then we have to do exception handling.
In Java, exceptions are objects. When you throw an exception, you throw a java object. You can't throw just any object as an exception
however -- only those objects whose classes descend from Throwable class. Throwable class serves as the base class for an entire
family of exception classes, declared in java.lang package, that your program can instantiate and throw.
Exception Class Hierarchy in java