Skip to main contentSkip to solution

Arrange the following in the correct order of handling exceptions.

(A) Exception is raised.

(B) Run time system searches for exception handler in the current method.

(C) An Error encountered in a method.

(D) Create Exception Object.

Solution

✅ Correct Option: 3

An error in a method first creates an exception object, which is then thrown (raised) to the run time system. Only after that does the run time system look for a handler, starting in the current method.

(C) An Error encountered in a method.

(D) Create Exception Object.

(A) Exception is raised.

(B) Run time system searches for exception handler in the current method.


Options 2 and 4: the handler search (B) cannot come before the exception is raised (A), because the run time system searches only after the object is thrown to it.

Keyboard Shortcuts

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