Does C# support multiple inheritance?

后端 未结 17 753
傲寒
傲寒 2020-11-27 05:34

A colleague and I are having a bit of an argument over multiple inheritance. I\'m saying it\'s not supported and he\'s saying it is. So, I thought that I\'d ask the brainy

17条回答
  •  庸人自扰
    2020-11-27 05:52

    Actually, it depends on your definition of inheritance:

    • you can inherit implementation (members, i.e. data and behavior) from a single class, but
    • you can inherit interfaces from multiple, well, interfaces.

    This is not what is usually meant by the term "inheritance", but it is also not entirely unreasonable to define it this way.

提交回复
热议问题