开发者

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

开发者 https://www.devze.com 2022-12-31 12:51 出处:网络
This question already has answers here: 开发者_Go百科Closed 12 years ago. Possible Duplicate: Should C# include multiple inheritance?
This question already has answers here: 开发者_Go百科 Closed 12 years ago.

Possible Duplicate:

Should C# include multiple inheritance?

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


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

Further details, HERE.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号