what is Inheritance and how to implement it?

      It is one of the important fourth pillar of OOPs which is used for implementing reusabilty. Inheritance is nothing but a technique of creating new classes based on the existing class too use its data members.

                   Whenever we use the concept of inheritance there will be at least 2 classes  Parent class(Super class)  the second one is called child class(derived class) which acquires the data members from the parent class

 When it comes to inheritance even now C++ is supreme because it supports all the 5 types of inheritance where as C# and Java does't support  2 types of inheritance that is multiple inheritance and hybrid inheritance is not supported by Java and C#  following  example look at below





Comments

Blogs