Ask Question
19 September, 02:47

Is the type of the exception object that gets thrown always the same as the exception type declared in the catch clause that catches the exception? If not, why not?

+5
Answers (1)
  1. 19 September, 05:22
    0
    Yes is the correct answer for the above question.

    Explanation:

    The exception is a run time error, which is caused during the execution of the program. for example, 100/0 is not a compile-time error but it is a run time error because divisible by 0 to any number is not possible. If the exception generates, then there is a need to catch which catches the exception to stop the program for its abnormal termination. If any object is thrown, then it searches his type of object to handle the exception because no other type of objects can handle the exception. It is also asked by the question. Hence yes is the answer to the above question.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Is the type of the exception object that gets thrown always the same as the exception type declared in the catch clause that catches the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers