Exception Types:
All exception types are subclasses of the built in class Throwable. Therefore, Throwable is at the top of the exception class hierarchy. Instantly below Throwable are two subclasses which partition exceptions into two distinct branches. One branch is headed through Exception. This class is used is used for exceptional conditions in which user programs should catch. This is also the class which you will subclass to create your own custom exception types. There is a very important subclass of Exception, known as RuntimeException. An Exception of this type is automatically described for the programs which you write and involve things such as division through zero and invalid array indexing.
The other branch is topped through Error that declares exceptions which are not expected to be caught under normal circumstances through your program. Exceptions of type Error are used through the Java run-time system to denote errors having to do along with the run-time environment, itself. Stack overflow is an instance of such an error. This lesson will not be dealing with exceptions of type Error, since these are classically created in response to catastrophic failures which cannot commonly be handled through your program.