Multiple choice technology programming languages

Can we have a virtual constructor for a class?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Virtual constructors are impossible in C++ because constructing an object requires knowing its exact type at compile-time for memory allocation. Virtual dispatch works through vtables on already-constructed objects, but construction must happen before the object (and vtable) exists. Therefore, constructors cannot be virtual.