1

Possible Duplicate:
Why is Multiple Inheritance not allowed in Java or C#?

I wanted to know why does c# not support multiple inheritance? I know it is possible using interfaces, but what is the reason for the compiler not to support multiple inheritance?

Community
  • 1
  • 1
lloydom
  • 377
  • 2
  • 11
  • Possible Duplicate http://stackoverflow.com/questions/191691/should-c-include-multiple-inheritance http://stackoverflow.com/questions/2865302/why-c-sharp-doent-support-multiple-inheritance – Asif Mushtaq Jun 14 '12 at 07:26
  • Check this : [enter link description here][1] [1]: http://stackoverflow.com/questions/995255/why-is-multiple-inheritance-not-allowed-in-java-or-c – Sunny Jun 14 '12 at 07:29

2 Answers2

0

It was refused by MS as too complicated to manage relationship in OOP design as benefits gained from it don't worth the complexity you should manage in framework.

Tigran
  • 61,654
  • 8
  • 86
  • 123
0

C# and the .net CLR have not implemented MI because they have not concluded how it would inter-operate between C#, VB.net and the other lanaguages yet, not because "it would make source more complex"

The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?

Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.

Talha
  • 18,898
  • 8
  • 49
  • 66