ACtE08 · Chapter 8Mock Test 06🏛️ Past Licensure QuestionID: fe8620b3
In object-oriented programming (such as C++ or Java), how many catch blocks can be associated with a single try block?
In object-oriented programming (such as C++ or Java), how many catch blocks can be associated with a single try block?
Multiple Choice Options
- A
Only 1
- B
Only 2
- C
Maximum up to 127
- D✓ Correct Option
As many as required
Detailed Technical Solution & Explanation
In modern object-oriented exception handling architectures (C++, Java, C#), a single try block can be followed by multiple sequential catch blocks to handle distinct exception types independently. There is no artificial compiler ceiling (like 1, 2, or 127); a developer can associate as many catch blocks as required to trap specific exception classes, followed optionally by a general default handler (catch(...) in C++ or catch(Exception e) in Java).
Option Analysis:
•
Option A (Only 1): Incorrect; multiple catch blocks are routinely used for polymorphic exception handling.
•
Option B (Only 2): Incorrect; no such restriction exists.
•
Option C (Maximum up to 127): Incorrect; arbitrary fictitious numerical limit.
•
Option D (As many as required): Correct; language grammars permit arbitrary chaining of distinct catch handlers to a single try block.
Reference: Mock Test 06NEC Licensure Syllabus