Need multiple inheritance functionality in C#. What am I doing wrong?

后端 未结 6 1894
野性不改
野性不改 2021-01-19 09:08
class UDPClient
{
}

class LargeSimulator
{
}

class RemoteLargeSimulatorClient : UDPClient, LargeSimulator
{
}

The saying goes, if you need multip

6条回答
  •  一整个雨季
    2021-01-19 09:19

    You can only inherent from a single base class in C#. However, you can implement as many Interfaces as you'd like. Combine this fact with the advent of Extension Methods and you have a (hacky) work-around.

提交回复
热议问题