Yesterday, One of my friends, Dharmendra ask me why C# does not support multiple inheritance. This is the question most of the people ask every time. So I thought it will be good to write a blog post about it. So why it does not support multiple inheritance?
I tried to dig into the problem and I have found the some of good links from C# team from Microsoft for why it’s not supported in it. Following is a link for it.
http://blogs.msdn.com/b/csharpfaq/archive/2004/03/07/85562.aspx
Also, I was giving some of the example to my friend Dharmendra where multiple inheritance can be a problem.The problem is called the diamond problem. Let me explain a bit. If you have class that is inherited from the more then one classes and If two classes have same signature function then for child class object, It is impossible to call specific parent class method.
I tried to dig into the problem and I have found the some of good links from C# team from Microsoft for why it’s not supported in it. Following is a link for it.
http://blogs.msdn.com/b/csharpfaq/archive/2004/03/07/85562.aspx
Also, I was giving some of the example to my friend Dharmendra where multiple inheritance can be a problem.The problem is called the diamond problem. Let me explain a bit. If you have class that is inherited from the more then one classes and If two classes have same signature function then for child class object, It is impossible to call specific parent class method.