Computer Science, asked by priyasekaran11, 6 months ago

Write a program for hybrid inheritance using constructor and destructor ​

Answers

Answered by anandachandra1980
1

Answer:

Constructors and Destructors In inheritance

Constructors and Destructors In inheritanceIt is very interesting for the curious learner to know whether constructors and destructors also inherited parent class to child class or not

Constructors and Destructors In inheritanceIt is very interesting for the curious learner to know whether constructors and destructors also inherited parent class to child class or notWhen we are using the constructors and destructors in the inheritance, parent class constructors and destructors are accessible to the child class hence when we create an object for the child class, constructors and destructors of both parent and child class get executed

Constructors and Destructors In inheritanceIt is very interesting for the curious learner to know whether constructors and destructors also inherited parent class to child class or notWhen we are using the constructors and destructors in the inheritance, parent class constructors and destructors are accessible to the child class hence when we create an object for the child class, constructors and destructors of both parent and child class get executed

Explanation:

  • hope its help you
Answered by keyboardavro
1

Answer:

Base class constructors are called first and the derived class constructors are called next in single inheritance. Destructor is called in reverse sequence of constructor invocation i.e. The destructor of the derived class is called first and the destructor of the base is called next.

Explanation:

Similar questions