Exception handling makes a language robust. This Exceptions Tutorial for Beginners explains concepts in Simple terms Examples Screenshots. Go on reading.
The programmer faces two types of problems in coding – problems arising at compile-time and problems arising at runtime. Regarding compile-time problems or mistakes the compiler takes care of and ultimately does not compile the program. Generally, a novice, first time learning a programming language, thinks if his program is complied successfully, the output is guaranteed. He is not aware of that at runtime also problems may arise that may stop the program execution abruptly. The problems that arise at runtime are known as "exceptions". Simply, exceptions can be defined as runtime errors.
With this basic understanding, let us go still deeper in Exceptions Meaning.
Mostly, the exceptions are caused by the user’s wrong interaction with a running program; feeding wrong input values at runtime which the system is unable to interpret and execute. If the system (Java Runtime Environment) is unable to determine what to do, it simply terminates the execution. An exception, as you understand by its literal meaning, does not arise every time; arises occasionally. It is an unexpected situation caused with the user’s incorrect input to the program.
If an exception arises, the JRE does not handle it implicitly. If not handled and not informed to the user what happened, he will be in a big confusion and thinks that software is not working properly now and then. The process of informing the user what happened and to see the program executes to the last statement, even if exception arises, is known as exception handling. Java comes with a robust exception handling mechanism, a feature of modern languages.
After understanding what exceptions are in this Exceptions Tutorial, go to the first program on exceptions.