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
C# does not support multiple inheritance of classes, but you are permitted to inherit/implement any number of interfaces.
This is illegal (B, C, D & E are all classes)
class A : B, C, D, E
{
}
This is legal (IB, IC, ID & IE are all interfaces)
class A : IB, IC, ID, IE
{
}
This is legal (B is a class, IC, ID & IE are interfaces)
class A : B, IC, ID, IE
{
}
Composition over inheritance is a design pattern that seems to be favorable even in languages that support multiple inheritance.