How to avoid a class from instantiation?
Answer Posted / vinay bondade
Have a Pure Virtual function in the class. This will not
allow to create an object of the class and hence cannot be
instatiated. But its a different thing to inherit the class
and give definition to Pure Virtual function, But the class
alone cannot be instantiated.The class hence,is also called
Abstract Base class.
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is purpose of abstract class?
How does work in c++?
What is the basic of c++?
How are virtual functions implemented in c++?
How do you sort a sort function in c++ to sort in descending order?
Do class declarations end with a semicolon?
Are vectors faster than arrays?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
Tell me what are static member functions?
What is the main function c++?
If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?
Distinguish between new and malloc and delete and free().
Why is the function main() special?
What is the function of I/O library in C++ ?
What is encapsulation in c++?