Answer the question
In order to leave comments, you need to log in
Why would you want to hide interface methods?
Good afternoon, connoisseurs! Please give an example when I need to hide an interface method by declaring it explicitly.
public sealed class Sample: ISample
{
public void InterfaceMethod()
{
// do something here
}
void ISample.SecondInterfaceMethod()
{
// do something here that should be used only by ISample interface
}
}
Answer the question
In order to leave comments, you need to log in
Array explicitly implements ICollection.Count so as not to pollute the interface with the same properties.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question