Answer Posted / meet
Constructor cannot be virtual. Because C++ is statically typed language. It is meaningless to the C++ compiler to create the object polymorphically. But it is possible to achieve behaviour like virtual constructor. This can be done by using factory design pattern.
Visit this link to know more about virtual constructor:
http://www.geeksforgeeks.org/advanced-c-virtual-constructor/
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a hashmap c++?
What is the difference between global int and static int declaration?
What is the use of map in c++?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
How to demonstrate the use of a variable?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
When do we run a shell in the unix system? How will you tell which shell you are running?
Explain the concept of memory leak?
What is boyce codd normal form in c++?
Describe the advantage of an external iterator.
Is c++ primer good for beginners?
What is the use of pointer in c++ with example?
what kind of projects are suitable for c and c++
How will you call C functions from C ++ and vice-versa?
What are the types of array in c++?