You mean usage. Wright?
Here's a very short expalation:
A
Interface defines a
contract that the
derived class should implement.
Meaning it defines the methods(their signatures) that a class and/or struct should implement.
Also C#/.Net allows for multiple
Interface but single class inheritance.
Supose you have a LogSystem. That system should write something.
So:
interface IWrite
{
public void Write();
}
The interface above defines a contract for the classes.It's contract it's a single method in this case that returns null.
Now you could have like a WriteToLog class, WriteToOutput(e.g. console),
to a DB.
but all of this classes Implement the IWrite interface.
public class WriteToLog: IWrite{
public void Write(){
}
}
public class WriteToConsole: IWrite{
public void Write(){
}
}