Interface in C#
Interface in C# has been introduced to implement multiple inheritance, which is not possible using the Classes. You can go through my article why .NET does not support Multiple inheritance. Using interfaces we can implement two or more interface contract to a single class which I will show with some interface example. I have said the word contract here as it is mandatory for the derived class to implement all the functions implemented by the interface.
Why C# doesn’t support multiple inheritance?
I have started writing my new blog about the Interfaces in C#. But as soon as we read about interfaces, the first thing everyone mentions is that C# does not support multiple inheritance(MI) rather it supports MI but in its downgraded version viz. MI is supported in .NET framework using interfaces which I would discuss in my next blog. Why C# doesn’t support multiple inheritance ? I thought let’s first write about the logic behind not supporting MI in .NET using classes.
Multiple inheritance is form of inheritance where two or more classes are inherited by the derived class