Monday, 24 August 2015

Why multiple inheritance is not possible in c#

C# compiler is designed not to support multiple inheritence because it causes ambiguity of methods from different base class.
If multiple inheritance would have allowed in the C#, there would be a problem so called "Diamond Problem". Diamond problem occurs when same method exist in two or more base classes. Thus the child class would end up inheriting duplicate methods.

Multiple inheritance is not possible beacuse Multiple inheritance Suffer From Ambugity Problem,that means there can be chances that same method present in both the call.

No comments:

Post a Comment