Assume that we have constructor functions for both base class and derived class. Now consider the declaration in main ( ). Base * P = New Derived; in what sequence will the constructor be called?
A. Derived class constructor followed by Base class constructor.
B. Base class constructor followed by derived class constructor.
C. Base class constructor will not be called.
D. Derived class constructor will not be called.
Answer:B
Assume that we have constructor functions for both base class and derived class. Now consider the declaration in main ( ). Base * P = New Derived; in what sequence will the constructor be called?
A. Derived class constructor followed by Base class constructor. B. Base class constructor followed by derived class constructor. C. Base class constructor will not be called. D. Derived class constructor will not be called.