📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    In an Object-Oriented program, which control flow

    construct is primarily used to handle unexpected events or errors that occur during program execution, such as file not found or network connection issues? 
    A `if-else` statements Correct Answer Incorrect Answer
    B `for` loops Correct Answer Incorrect Answer
    C `try-catch` (or `try-except`) blocks Correct Answer Incorrect Answer
    D `switch-case` statements Correct Answer Incorrect Answer

    Solution

    `try-catch` (or `try-except` in Python) blocks are specifically designed for exception handling, allowing programs to gracefully manage and recover from runtime errors or unexpected conditions.

    Practice Next
    ask-question