Amazon Interview Question
Software Engineer / DevelopersCountry: United States
Checked Exceptions are those exceptions that the programmer need to anticipate while coding and provide proper handling in the code. Compiler will give an error if the checked exceptions are not defined while using certain features.
Unchecked exceptions are those exceptions that are generally not anticipated and they occur at run-time. These kind of exceptions are not supposed to be handled by the programmer and should let the jvm terminate in such cases.
Checked exceptions are exceptions like IOException, they must be handled by programmer using try/catch block.
- mageshkhanna March 19, 2012Unchecked exceptions are exceptions like NullPointerException, ArrayIndexOutOfBoundException it is not necessary to handle those exception
Compiler will not allow to run without handling the checked exception but it will allow to have unchecked exceptions in our code because it is not definite that an unchecked type of exception will occur at run time.