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

后端 未结 8 1498
再見小時候
再見小時候 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:43

    You don't use an interface in the sense of calling it. An interface is just a contract defining which methods you can call essentially. You always call the implementation.

提交回复
热议问题