Ask Question

Where does execution resume after an exception has been thrown and caught?

+2
Answers (1)
  1. 21 January, 15:48
    0
    The execution resumes in the finally block if one exists or otherwise from the next statement following the try ... catch block.

    Explanation:

    Once an exception has been thrown and caught in the code, the execution continues with the statements in the finally block if one exists. If there is no finally block defined then execution resumes from the next statement following the try ... catch block. For example:

    try{

    //An exception is raised

    }

    catch (Exception e) {

    //Exception is handled

    }

    System. out. println ("After try ... catch");

    In this code segment, the next statement to be executed after catch is the System. out. println ();
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Where does execution resume after an exception has been thrown and caught? ...” 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