How to avoid a class from instantiation?
Answer Posted / chandrakant
make the class Abstract it will not be instantiated
and the pure virtual function is used to avoid the base call
function to be get called if we make a function as virtual
only a derived class function will get called
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What new()is different from malloc()?
List the advantages of inheritance.
Explain the difference between c & c++?
What are arithmetic operators?
Differentiate between late binding and early binding. What are the advantages of early binding?
How do you show the declaration of a virtual constructor?
What is a class template?
Why do we need function?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
What is c++ try block?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is a breakpoint?
What is problem with overriding functions?
What are the two types of comments?
Describe the process of creation and destruction of a derived class object?