Inheritance in C#

Introduction: First of all, I would like to give an answer to a question “ What is Inheritance in C# ?” . Inheritance enables a class to be extended, modify the behavior that is defined in other class. It means After inheriting a class into others it just encapsulates the future of a base class. Now I want to show how we can implement multiple inheritance for our application.
Single Inheritance in C# :

 

It shows error Class Single inheritance can not have a multiple base class. But this problem can be solved by an interface. So now we can say that “C# directly doesn’t support multiple inheritances but we can implement this via Interface.” Now as MSDN say we can inherit single base class but multiple interfaces. This is the form of multiple Inheritance in C#.

C#

Anand Kumar
@anandkumarv

Anand Kumar

Sr.Tech Lead at CsharpMagic
I am founder of csharpmagic.com and by profession Sr.Tech Lead. I like to explore New Technologies, New Business idea and many more
Anand Kumar
@anandkumarv

Latest posts by Anand Kumar (see all)

Anand Kumar

I am founder of csharpmagic.com and by profession Sr.Tech Lead. I like to explore New Technologies, New Business idea and many more

Leave a Reply

Your email address will not be published. Required fields are marked *