Skip to main contentSkip to solution

Arrange the following in order in the context of exception handling:

(A) Program Termination

(B) Exception is raised

(C) Error occurs in a program

(D) Catching an exception

Solution

✅ Correct Option: 1

(C) Error occurs in a program: something goes wrong at run time, such as division by zero.

(B) Exception is raised: the runtime creates an exception object and passes it up the call stack.

(D) Catching an exception: a matching handler (catch or except block) receives the exception and deals with it.

(A) Program termination: the program ends, normally or after cleanup, once the exception has been handled.


Option 4: termination comes before catching, but an exception that is caught is handled so the program can continue. Termination happens only after handling, or when no handler is found.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question