Discussion :: Constructors and Destructors
-
What will be the output of the following program?
#include class Freshergate { public: GATEBase() { cout"Base OK. "; } }; class GATEDerived: public GATEBase { public: GATEDerived() { cout"Derived OK. "; } ~BixDerived() { cout"Derived DEL. "; } }; int main() { GATEBase objB; GATEDerived objD; objD.~GATEDerived(); return 0; }
|
A.
Base OK. Derived OK. Derived DEL. |
|
B.
Base OK. Base OK. Derived OK. Derived DEL. |
|
C.
Base OK. Derived OK. Derived DEL. Derived DEL. |
|
D.
Base OK. Base OK. Derived OK. Derived DEL. Derived DEL. |
|
E.
The program will report compile time error. |
Answer : Option D
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook