InterviewSolution
| 1. |
What do you understand about exceptions in the context of the Java programming language? What are the different types of exceptions in Java? |
|
Answer» An EXCEPTION is an unwelcome or unexpected occurrence that occurs during the execution of a program, i.e. at run time, and disturbs the program's usual flow of instructions. The APPLICATION can detect and handle exceptions. When a method throws an exception, it creates an object. The exception object is the name given to this object. It contains details about the exception, such as the name and DESCRIPTION of the error, as well as the program's state at the time the error occurred. An exception can happen for a variety of reasons. Here are a few examples:
Java defines several different types of exceptions for its various class libraries. Users can also define their exceptions in Java. The following are the different types of exceptions in Java:
|
|