Interfaces give you the ability to define behavior without actually implementing it. Why would you want to do that? Your classes can then declare support for interfaces which means that they promise to support that behavior. How your classes do this is up to them. Declaring support for an interface signals that they do this. You can have what might be completely unrelated classes all supporting the same interface which then allows you to work with them in the same way.

Some common interfaces in C# are:

  • IComparable
  • IComparer
  • IDisposable
  • Innumerable
  • IEqualityComparer
  • IEquatable
  • INotifyPropertyChange
  • IQueryable
  • ISerializable