Why multiple inheritance is not possible in c#?

 Posted by Rajeshatkiit on 12/16/2015 | Category: C# Interview questions | Views: 3909 | Points: 40
Answer:

This is Cause by diamond Shape problems of two classes. If two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override it), and B and C have overridden that method differently, then via which class does it inherit: B, or C? It creates ambiguity and Simply, it will increase the complexity. So., multiple inheritance is not possible in C#. that is called Diamond Problem. But., in C# we can solve the Diamond problem with the help of interfaces in some cases.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response