The sequence of steps of exception handling process is:
(A) Exception object is created
(B) Exception is raised
(C) An error is encountered in a method
(D) Runtime system searches for exception handler in the current method
The sequence of steps of exception handling process is:
(A) Exception object is created
(B) Exception is raised
(C) An error is encountered in a method
(D) Runtime system searches for exception handler in the current method
Solution
(C) An error is encountered in a method
(A) The method creates an exception object holding the error type and program state
(B) The exception is raised (thrown) to the runtime system
(D) The runtime system searches for an exception handler, starting in the current method and then moving up the call stack
Options 1 and 2: an exception object cannot exist before an error occurs, so (C) must come first.
Option 3: an exception cannot be raised before its object is created, and the handler search comes after raising, not before the error.
Related questions:
2025: 15 May Shift 2
2026: 18 May Shift 2
2025: 3 June Shift 2
2025: 30 May Shift 2