I can\'t seem to find an answer on this and just want to make sure it\'s an ok coding standard. I have interface A
that is used by many different classes and don\'
Technically speaking, interfaces don't inherit from each other. What really happens when you create an IFoo
that inherits from IBar
, you're saying that any class that implements IFoo
must also implement IBar
.
interface IBar
{
void DoBar();
}
interface IFoo : IBar
{
void DoFoo();
}
In this example, the IFoo
interface does not have a DoBar()
method. Most of the time the distinction doesn't matter, but it can bite you when using reflection on an interface rather than a class.