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
When is dynamic checking necessary?
Explain binary search.
What is an adaptor class in c++?
Explain the concept of copy constructor?
What do you mean by enumerated data type?
What do you mean by inheritance in c++?
What information can an exception contain?
Write a C++ Program to check whether a number is prime number or not?
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
Define 'std'.
What is the importance of mutable keyword?
Explain the scope of resolution operator.
What is flag in computer?
Why do we need runtime polymorphism in c++?
What methods can be overridden in java?