An interface is a view to a class, sort of.
You tell the compiler that a class implements an interface. Compiler will then monitor that the class implements all methods that belong into that interface. If one method is missing or with wrong signature, compiler will not accept it.
So you're sure you can use your class as if it was an instance of the interface it implements (even though interfaces cannot be instantiated, classes that implement it can).
interface IExampleInterface
{
public string TellMeSomething();
}
public class ExampleClass : IExampleInterface
{
public string TellMeSomething()
{
return("That's Something!");
}
}
int Main(whatever)
{
IExampleInterface exampleInstance = new ExampleClass();
string result = exampleInstance.TellMeSomething();
}