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 a c++ object?
Can I create my own functions in c++?
Why is null pointer used?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is the basic of c++?
What do you mean by global variables?
Explain the difference between c++ and java.
What is static in c++?
Explain the difference between new() and malloc() in c++?
What is time_t c++?
What does h mean in maths?
Explain polymorphism?
Where is atoi defined?
Explain about vectors in c ++?
What is fixed in c++?