Why C# doen't support multiple inheritance [duplicate]

陌路散爱 提交于 2019-11-27 04:53:21

问题


Possible Duplicate:
Should C# include multiple inheritance?

One of my friend asked me the question i.e.Why C# doen't support multiple inheritance


回答1:


Using interfaces is more flexible and eliminates the ambiguity of multiple inheritance.

Further details, HERE.




回答2:


Multiple inheritance complicates the language and its implementation. I suspect the designers decided that the gains weren't worth the pains.




回答3:


C#, like Java supports a way to deal with multiple inheritance by allowing a class to implement multiple Interfaces. Its not quite multiple inheritance but it can accomplish what you want to get done.



来源:https://stackoverflow.com/questions/2865302/why-c-sharp-doent-support-multiple-inheritance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!