Object Oriented Programming207910 marks
Explain the chain of constructor and destructor between sub classes and super classes during inheritance with example.Create a class named 'Point' with data members x and y. Overload the + operator to add the value of two objects of this class.[5+5]
Explain the chain of constructor and destructor between sub classes and super classes during inheritance with example.Create a class named 'Point' with data members x and y. Overload the + operator to add the value of two objects of this class.[5+5]
--- (a) Chain of Constructor and Destructor in Inheritance In C++ inheritance, when an object of a derived (sub) class is created or destroyed, constructors and destructors are called in a specific order involving both the base (super) class and the derived class. When a derived class object is c...