1.

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» The correct option is (a) Then catch block of derived class must be defined before base class

The explanation is: 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.


Discussion

No Comment Found

Related InterviewSolutions