Google News
logo
CPP - Quiz(MCQ)
Where should we place catch block of the derived class in a try-catch block?
A)
After all the catch blocks
B)
After the catch block of Base class
C)
Before the catch block of Base class
D)
Anywhere in the sequence of catch blocks

Correct Answer :   Before the catch block of Base class


Explanation : C++ asks the programmer to place the catch block of derived class before a catch block of the base class, otherwise derived catch block will never be executed.

Advertisement