Okay so what are interfaces and what makes them different from classes? Well an interface is like a contract for a class, that tell that class it must implement all the methods, properties, events and indexers of the named interface. Lets say you create a simple class and a simple interface like this:
class myTestClass : IMyTestInterface
{
public myTestClass()
{
}
}
interface IMyTestInterface
{
void DoMyFunction();
void DoMySecondFunction();
}
You will get a compiler error, because MyTestClass is required to implement DoMyFunction and DoMySecond. So what are interfaces used for and what makes it better than just a regular class. Well for one, you can implement multiple interfaces, and as you may know C# does not support multiple inheritance. You can for example implement an interface from one or more other interfaces.
Place your comment