C# Does not support Multiple Inheritance...It supports multiple Interface Implementations... Example For implementing multiple interfaces There are workaround which help you inherit multiple classes in a class...but Multiple Inheritance in one class is not possible without the use of Interfaces ...
Yeah C# and Asp.net does not support multiple inheritance. It only supports Single or multilevel inheritance.
Suppose Multiple Inheritance were allowed We have two class (ClassA and ClassB) with a same method name. Now we inherit the ClassC from both the class. Now we will fall in situation where we do not know who's who? To avoid this confusion .net along with other OOP based programming languages doesn't allow MI.
multiple Inheritance in ASP.NET is done through interface as given below : interface ISampleInterface { void SampleMethod(); } class ImplementationClass : ISampleInterface { // Explicit interface member implementation: void ISampleInterface.SampleMethod() { // Method implementation. } static void Main() { // Declare an interface instance. ISampleInterface obj = new ImplementationClass(); // Call the member. obj.SampleMethod(); } }
C# is an object oriented language and any object oriented language does not support multiple inheritance,it supports multiple interface implementation.
Yes,agree with the mates C# does not allow multiple inheritance but you can do it by implementing Multiple Interfaces
You can use interface in C#. It doesn't support multiple inheritance as it is an object oriented programming language.
I am really interested in knowing in which scenario are you planning to implement multiple inheritance ?
C# does not support multiple inheritance, so to overcome this problem Microsoft introduce interface you can implement multiple interfaces