Multiple Inheritance in C#

后端 未结 15 1826
醉酒成梦
醉酒成梦 2020-11-22 03:03

Since multiple inheritance is bad (it makes the source more complicated) C# does not provide such a pattern directly. But sometimes it would be helpful to have this ability.

15条回答
  •  死守一世寂寞
    2020-11-22 03:35

    You could have one abstract base class that implements both IFirst and ISecond, and then inherit from just that base.

提交回复
热议问题