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 the use of main function in c++?
What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00
What happens when you make call 'delete this;'?
What is copy constructor? Can we make copy constructor private in c++?
What is an operator function? Describe the function of an operator function?
Is c++ a programming language?
Specify some guidelines that should be followed while overloading operators?
What do you mean by const correctness?
What do you mean by translation unit?
Is c++ fully object oriented?
What do nonglobal variables default to a) auto b) register c) static
What is the rule of three?
What is the use of 'using' declaration in c++?
Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---
How do you find out if a linked-list has an end?