Ask Question
24 January, 14:08

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?

+2
Answers (1)
  1. 24 January, 18:04
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers