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


    Question

    Which of the following is used to handle exceptions in

    Java?
    A try-catch Correct Answer Incorrect Answer
    B if-else Correct Answer Incorrect Answer
    C switch-case Correct Answer Incorrect Answer
    D for loop Correct Answer Incorrect Answer
    E throw only Correct Answer Incorrect Answer

    Solution

    try-catch blocks in Java handle runtime exceptions. throw is used to explicitly throw an exception, while try-catch manages it.

    Practice Next
    ask-question