클래스가 동일한 서명을 가진 멤버를 포함하는 두 개의 인터페이스를 구현하는 경우 클래스에서 해당 멤버를 구현하면 두 인터페이스에서 해당 멤버를 구현으로 사용합니다.
인터페이스 멤버를 명시적으로 구현하는 것이 가능합니다. 인터페이스를 통해서만 호출되고 해당 인터페이스에 고유한 클래스 멤버를 생성합니다.
예
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();
}
}