Can we have a virtual constructor in C++?
Answer:
The Constructor can’t be virtual as the constructor is a code that is responsible for creating an instance of a class and it can’t be delegated to any other object by virtual keyword means.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Answer:
The Constructor can’t be virtual as the constructor is a code that is responsible for creating an instance of a class and it can’t be delegated to any other object by virtual keyword means.
need an explanation for this answer? contact us directly to get an explanation for this answer