An exception is kind of error or problem , which occurs during the execution of a program, that terminates abnormally the normal flow of the program.
It could be multiple reason for occurring error during execution of program like It could be invalid input , programmer error and physical & network issue etc.
we can categorize to exceptions in three categories
- Checked : it is compilation-time exception means it can be recognize by compiler during write code. Programmer should handle these exceptions during write code. like FileNotFoundException etc
- Unchecked : it is run-time exception means it cannot recognize by compiler. Its kind of bug which is present in code. like NullPointerException
- Errors : These are not exceptions, but kind of problems that arise beyond the control of programmer. like stack overflow etc.