Inheritance
Taking the properties of one class into another class is called inheritance.
Types of inheritance in C#
•Single
•Hierarchical
•Multilevel
•Multiple inheritance using Interfaces
Single inheritance
•It is the type of inheritance in which there is one base class and one derived class.
![](https://techaid71.xyz/wp-content/uploads/2021/10/image-1.png)
•This is the type of inheritance in which there are multiple classes derived from one base class. This type of inheritance is used when there is a requirement of one class feature that is needed in multiple classes.
![](https://techaid71.xyz/wp-content/uploads/2021/10/image-2.png)
•When one class is derived from another derived class then this type of inheritance is called multilevel inheritance.
![](https://techaid71.xyz/wp-content/uploads/2021/10/image-3.png)
Multiple inheritance using Interfaces
•C# does not support multiple inheritances of classes. To overcome this problem we can use interfaces, we will see more about interfaces in my next article in detail.
![](https://techaid71.xyz/wp-content/uploads/2021/10/image-4.png)