Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible?

A: There is nothing like Virtual Constructor. The Constructor can’t be virtual as the constructor is a code which is responsible for creating an instance of a class and it can’t be delegated to any other object by virtual keyword means.

6 comments:

Uttam Agrawal said...

To Find out answers to the following questions click on the links provided:

Question - 1) What is a class ?

Question - 2) What is an object ?

Question - 3) List the advantages of object oriented programming ?

Question - 4) What is meant by 'call by value' ?

Question - 5) What is meant by 'call by reference' ?


Question - 6) What is a reference variable ? What is its use ?

Question - 7) What are inline functions ? What is the advantage of using them ? How are they declared ?

Question - 8) What are the defining traits of an object-oriented language ?

Question - 9) What is the purpose of the scope resolution operator ?

Question - 10) What are the differences between type casting and automatic type conversion ?


Question - 11) Why ‘char’ is often considered as an integer data type ?

Question - 12) What is the difference between structure and class in C++ ?

Question - 13) What is the purpose of ios:app ?

Question -14) What is the purpose of ios::ate ?

Chaitanya Reddy said...

Virtual constructor not possible.Because at the time of object construction Vtable is not created.

http://ccppcoding.blogspot.in/

Aarohi Shirke said...
This comment has been removed by the author.
asitbangalorereviews said...

Good one...
c++ interview questions and answers

asitbangalorereviews said...

Good collection..
Core Java Interview Questions and Answers
c++ interview questions and answers
Mysql Interview Questions and Answers

Sujitkumar said...

Nice info. Thanks for sharing valuable info about about c++ Faqs. I want to learn c training this tutorial is really helpful. Thanks a lot. Keep sharing on updating tutorials……