When you implement two interfaces with the same method, how do you know which one is called?

后端 未结 8 1553
再見小時候
再見小時候 2021-01-13 05:18

If you have TheMethod() in interfaces I1 and I2, and the following class

class TheClass : I1, I2
{
    void TheMethod()
}

If s

8条回答
  •  长情又很酷
    2021-01-13 05:49

    The real question is, "Who cares which interface it is using?" Really, it's not "using" the interface at all. It's using the implementation to fulfil the interface.

提交回复
热议问题