Exceptions Exceptions are situations in which something unexpected occurs during the execution of a program. Java provides exception classes, children of the Exception class. Each such exception has a name, like Division by zero.
User enters letters when a number is requested.
A class is not found by the run-time interpreter. When one of these or many other kinds of such situations occur, the JVM throws an exception, which, if not caught and dealt with by your program, will cause the program to be aborted. The statements within the try block are executed. If an exception is thrown within this block, the JVM searches sequentially until it finds a match within the catch blocks. If it finds a match, it executes the code within that catch block, then execution jumps to the end of all the catch blocks.