October 2010
Intermediate to advanced
1920 pages
73h 55m
English
An interface is a list of properties and methods that a class must implement. If a class implements an interface, you know that the class includes all the properties and methods contained in the interface.
For example, the file in Listing 17.20 contains an interface named IProduct and two components named MusicProduct and BookProduct.
Listing 17.20. Products.cs


Both components in Listing 17.17 are declared as implementing the IProduct interface. (The colon can mean implements or inherits.) Furthermore, both components include ...