ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: 82aaf182
In C++ exception handling, the code block responsible for catching and handling an active exception is the:
In C++ exception handling, the code block responsible for catching and handling an active exception is the:
Multiple Choice Options
- A✓ Correct Option
catch block (exception handler)
- B
throw expression
- C
try block
- D
finally block
Detailed Technical Solution & Explanation
A catch block (also called an exception handler) is positioned immediately following a try block to intercept and process exceptions thrown by throw expressions.
Option Analysis:
•
Option A (catch block (exception handler)): Correct. Executes recovery logic when an exception is caught.
•
Option B (throw expression): Signals/raises the exception.
•
Option C (try block): Encloses the code that might throw an exception.
•
Option D (finally block): Exists in Java/C#, but not in standard C++ (which relies on RAII).
Reference: Mock Test 07NEC Licensure Syllabus