Assume that we have constructor functions for both the base class and the…

UGC NET 2012

Assume that we have constructor functions for both the base class and the derived class. Now consider the following declaration inside main():

Base *P = new Derived;

In what sequence will the constructors be called?

  1. A.

    Derived class constructor followed by Base class constructor.

  2. B.

    Base class constructor followed by derived class constructor.

  3. C.

    Base class constructor will not be called.

  4. D.

    Derived class constructor will not be called.

Attempted by 39 students.

Sign up free to check your answer

Sign up free

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…