An exception is an abnormal situation that can arise in your program. When your program encounters an abnormal situation, it will throw an exception. The JVM will create an instance of
java.lang.Exception (or one of it’s subclasses) which encapsulates the abnormal situation. It will then pass (throw) the object as an argument to an appropriate exception handler in the call stack. If you don’t provide an appropriate exception handler yourself, the JVM will look for a default exception handler in the current
thread.
Exception handlers can handle
java.lang.Throwable objects i.e. all errors and exceptions that can occur in a
Java program. In other words, some abnormal situations will cause the JVM to create an instance of
java.lang.Error (or one of it’s subclasses), however, you typically won't need to bother with these types of abnormal situations.