2

Possible Duplicates:
Should C# include multiple inheritance?
Why C# doen’t support multiple inheritance

Why C# does not support multiple inheritance where as C++ supports it and we have to achieve the same using Interface?

Community
  • 1
  • 1
Arup Chaudhury
  • 169
  • 3
  • 18

1 Answers1

7

We don't need to provide reasons for features to not be included. Rather, features must be justified on a cost-benefit basis. C# doesn't have multiple inheritance because the benefit of the feature does not justify the costs. Why should C# have multiple inheritance? It gets by without it perfectly well.

Eric Lippert
  • 647,829
  • 179
  • 1,238
  • 2,067
  • Actually this is a question asked in Accenture interview and some problem called Diamond problem was mentioned. – Arup Chaudhury Jul 17 '10 at 06:16
  • 4
    @Arup: if your question is actually "what are some of the interesting design problems involving multiple inheritance in C++?" then that's the question you should have asked. The answer to all questions of the form "why doesn't C# have feature X?" is either "no one thought of it", or "we thought of it but couldn't justify the cost given our budget". – Eric Lippert Jul 17 '10 at 06:20
  • Ok Eric got your point. I will try to put it that way next time. – Arup Chaudhury Jul 17 '10 at 06:37
  • 2
    @Arup Chaudhury, http://en.wikipedia.org/wiki/Diamond_problem – Zaki Jul 17 '10 at 06:38