Question

    What is the purpose of the finally block in exception

    handling?
    A It is executed when an exception occurs. Correct Answer Incorrect Answer
    B It is used to handle the exception. Correct Answer Incorrect Answer
    C It is executed regardless of whether an exception occurs or not. Correct Answer Incorrect Answer
    D It is used to re-throw the exception. Correct Answer Incorrect Answer

    Solution

    It is executed regardless of whether an exception occurs or not.

    Practice Next

    Relevant for Exams: