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
What is the difference between global int and static int declaration?
What is the size of a vector?
What is the difference between struct and class?
What is the main use of c++?
How do I write a c++ program?
what is Member Functions in Classes?
What is the difference between the parameter to a template and the parameter to a function?
How did c++ start?
How many different levels of pointers are there?
Can comments be nested?
Explain pass by value and pass by reference.
what are function pointers?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
what is data encapsulation in C++?
what is the difference between overloading & overriding? give example.