If both base and derived class caught exceptions ______________

If both base and derived class caught exceptions ______________
A. Then catch block of derived class must be defined before base class
B. Then catch block of base class must be defined before the derived class
C. Then catch block of base and derived classes doesn’t matter
D. Then catch block of base and derived classes are not mandatory to be defined
 
Answer: a
Explanation: It is a condition for writing the catch blocks for base and derived classes. It is mandatory to write derived class catch block first because the errors produced by the derived class must be handled first.
 

Tìm kiếm

Back
Top