How would you stop a class from class from being derived or
inherited?The constructer should not be Private,as object
instantiation should be allowed.
Answer Posted / boriska
make destructor private. Derived class would not be able to
access it, and compiler will produce error, when instance of
derived class is deallocated.
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Comment on c++ standard exceptions?
What is anonymous object in c++?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What is the difference between delegation and implemented-in-terms-of?
Does c++ support exception handling?
What is a constructor and how is it called?
What is a node class in c++?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What is the difference between #define debug 0 and #undef debug?
What is the use of volatile variable?
What is std :: flush?
Why #include is used?
What do you understand by a pure virtual member function?
What is dynamic and static typing?
What is runtime polymorphism in c++?