A colleague and I are having a bit of an argument over multiple inheritance. I\'m saying it\'s not supported and he\'s saying it is. So, I thought that I\'d ask the brainy
Multiple inheritance allows programmers to create classes that combine aspects of multiple classes and their corresponding hierarchies. For ex. the C++ allows you to inherit from more than one class
In C#, the classes are only allowed to inherit from a single parent class, which is called single inheritance. But you can use interfaces or a combination of one class and interface(s), where interface(s) should be followed by class name in the signature.
Ex:
Class FirstClass { }
Class SecondClass { }
interface X { }
interface Y { }
You can inherit like the following:
class NewClass : X, Y { } In the above code, the class "NewClass" is created from multiple interfaces.
class NewClass : FirstClass, X { } In the above code, the class "NewClass" is created from interface X and class "FirstClass".