如果一个类实现的两个接口包含一个具有相同签名的成员,则在类上实现该成员将导致两个接口都将该成员用作其实现。
可以显式实现接口成员-创建仅通过该接口调用且特定于该接口的类成员
interface ICar{
void display();
}
interface IBike{
void display();
}
class ShowRoom : ICar, IBike{
void ICar.display(){
throw new NotImplementedException();
}
void IBike.display(){
throw new NotImplementedException();
}
}
class Program{
static void Main(){
Console.ReadKey();
}
}