The term exceptions refers in Java to preventing an error that has a good chance of occurrence. Exceptions may occur for various reasons and can have different levels of severity. For example, if you want to load a file that does not exist on disk, if a file doesn't contains correct data, if a network connection fails, if there in an attempt illegal access of a bad memory, in all these cases must treat these cases.
In such a moment when an error occurs during the execution, will be generated an object of type exception that contains:
- Information about that exception;
- State of the program when the exceptions occurs;
Creating an exception object type is called throwing an exception. When the method generates (throwing) one exception, the execution system is responsible for finding a sequence code from one method to treat. Search is done recursively, starting with method that generated the exception and going back on line calls to that method. Sequence from one method to treat a specific exception called exception handler, and the interception and treatment it is called catch the exception.
…read more about Exception handling in Java





