Question

    What is the role of the catch block in exception handling?

    A It is executed regardless of whether an exception occurs or not. Correct Answer Incorrect Answer
    B It is used to re-throw the exception. Correct Answer Incorrect Answer
    C It is executed when an exception occurs and matches the specified type. Correct Answer Incorrect Answer
    D It is used to define the exception to be thrown. Correct Answer Incorrect Answer

    Solution

    It is executed when an exception occurs and matches the specified type

    Practice Next

    Relevant for Exams: