What will be the output of the following program? #include<iostream.h>
class CuriousTabBase
{
public:
CuriousTabBase()
{
cout<< "Base OK. ";
}
};
class CuriousTabDerived: public CuriousTabBase
{
public:
CuriousTabDerived()
{
cout<< "Derived OK. ";
}
~CuriousTabDerived()
{
cout<< "Derived DEL. ";
}
};
int main()
{
CuriousTabBase objB;
CuriousTabDerived objD;
objD.~CuriousTabDerived();
return 0;
}
Correct Answer: Base OK. Base OK. Derived OK. Derived DEL. Derived DEL.
Discussion & Comments