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 best c++ compiler for windows 10?
What are the various compound assignment operators in c++?
What is the function of I/O library in C++ ?
When do we run a shell in the unix system? How will you tell which shell you are running?
What is stl containers in c++?
Give example of a pure virtual function in c++?
What should main() return in c and c++?
Can I learn c++ without c?
What can I use instead of namespace std?
Write a Program to find the largest of 4 no using macros.
What is c++ hiding?
Can I uninstall microsoft c++ redistributable?
Differentiate between realloc() and free().
Is main a class in c++?
What is data type in c++?