Ask 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 exception? If not, why not?

+5
Answers (1)
  1. 22 August, 17:48
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers