Advertisements
Advertisements
Question
What is Inheritance ? Explain any two types of Inheritances with Memory.
Solution
The mechanism of deriving a new class from an old one is called as inheritance.The old class is referred as base class and new class is referred as derived class.
There are five types of inheritances in C++:
1. Single inheritance:
A derived class with only one base class is called as single inheritance. It has the form :
2. Multilevel inheritance:
The mechanism of deriving one class
shaalaa.com
C++ Programming
Is there an error in this question or solution?