Saturday, January 27, 2018

Interface in C# summary

An interface has the following properties:

  • An interface is like an abstract base class. Any class or struct that implements the interface must implement all its members.

  • An interface can't be instantiated directly. Its members are implemented by any class or struct that implements the interface.

  • Interfaces can contain events, indexers, methods, and properties.

  • Interfaces contain no implementation of methods.

  • A class or struct can implement multiple interfaces. A class can inherit a base class and also implement one or more interfaces.