可能性の重複:
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