Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 797
  • Last Modified:

why multiple inheritance is not supported in .Net

why multiple inheritance is not supported in .Net
0
winsoftech
Asked:
winsoftech
1 Solution
 
Gyanendra SinghArchitectCommented:
There is no definitive answer to this question. It is a matter of taste.

There is the classic diamond problem encountered in multiple inheritance, in which class D inherits from both B and C, which both inherit from A.

  A
 / \
B   C
 \ /
  D

So which copy of A does D get? The one from B, the one from C? Both? This way various languages resolve this problems is discussed here:

http://en.wikipedia.org/wiki/Diamond_problem

It is informative, if a bit dizzying, to read the last sentence in the explanation of the way C++ resolves this issue.

Here is an interesting discussion of this topic:

http://www.artima.com/intv/dotnet.html

Search on "Multiple Inheritance" in this discussion to hear Anders discuss this subject:

http://msdn.microsoft.com/msdntv/transcripts/20040624csharpahTranscript.aspx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now