There is nothing like a virtual constructor of a class.

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of constructors in object-oriented programming.

A constructor is a special member function of a class that is used to initialize objects of the class. It is usually called automatically when an object is created. Constructors have the same name as the class and do not have a return type.

In C++, there is no concept of a "virtual constructor." Virtual functions allow a derived class to provide its own implementation of a function defined in the base class. However, constructors cannot be virtual because they are responsible for creating objects and initializing their states, and the concept of virtual dispatch does not apply during object creation.

Therefore, the statement "There is nothing like a virtual constructor of a class" is true. Option A is correct.

Find more quizzes: