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 the basic structure of c++ program?
What is a linked list in c++?
What is a responder chain?
Write a C++ Program to check whether a number is prime number or not?
What is #include cstdlib in c++?
Which bit wise operator is suitable for checking whether a particular bit is on or off?
Explain how to initialize a const data member.
Write a code/algo to find the frequency of each element in an array?
What is using namespace std in c++?
what is VOID?
What is data abstraction? How is it different from data encapsulation?
What are the two types of polymorphism?
What do you mean by global variables?
What is std :: endl?
What is stl containers in c++?