An interface defines a contract. A class or struct that implements an interface must adhere to its contract. An interface looks like a class, but has no implementation. The only thing it contains are definitions of events, indexers, methods and/or properties. The reason interfaces only provide definitions is because they are inherited by classes and structs, which must provide an implementation for each interface member defined. Interfaces in C# are provided as a replacement of multiple inheritances. Because C# does not support multiple inheritance,
Public delegate void ChangeRegistrar(object sender, object event);
Public interface IBroker
String GetRating(String stock);
decimal this[String StockName]
event ChangeRegistrar PriceChange;
Note: - The interface name begins with the conventional I in IBroker. It has four members the GetRating() method, the PricePerTrade property, an indexer and the PriceChange event. The delegate type of the PriceChange property, ChangeRegistrar, is defined also. As mentioned earlier, interface members do not have implementations. It is up to a class or struct to implement interface member declarations.