C# FAQ: Does CSharp have multiple inheritance like Cplusplus

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:FAQs
edit

Does C# have multiple inheritance like C++ ?

No. C# does not have C++ style multiple inheritance. But, like the Java language, C#—and .NET languages generally—has multiple interface inheritance. An interface is similar to a pure abstract class. This means that a type can implement multiple interfaces but can only inherit a single implementation. So, a class can be derived from only one other class. That class, in turn, may inherit from another single class.

The reason for this is that multiple inheritance is difficult for developers to implement and debug efficiently. Multiple inheritance can lead to a host of diabolical situations which are difficult to diagnose and repair.

See also



Personal tools