가능한 중복 :
Why Explicit Implementation of a Interface can not be public?명시 적으로 구현 된 구성원을 공개 할 수없는 이유는 무엇입니까?
I read this Question. 직선 질문에서
interface IRepository<T>
{
void AddString();
}
interface IStringRepo : IRepository<string>
{
List<string> GetStrings();
}
public class BLL : IStringRepo
{
public List<string> FilterStrings()
{
return new List<string>() { "Hello", "World" };
}
public List<string> IStringRepo.GetStrings()
{
throw new NotImplementedException();
}
public void IRepository<string>.AddString()
{
throw new NotImplementedException();
}
}
이유는 명시 적으로 언급 된 멤버 공개는 Error
입니다 만드는 무엇입니까?
'public' 수정자가 무엇을 기대합니까? 보통 메서드 이름이 없기 때문에 적어도 일반 C# 코드에서이 메서드를 인터페이스를 통해서만 호출 할 수 있습니다. – CodesInChaos
언어 사양에 그렇게 나와 있기 때문에. – Jon
명시 적 인터페이스 구현'public'을 만들 수 있다면, 그 정상 (암시 적) 인터페이스 구현의 차이점은 무엇입니까? – svick