Lesson review
So, to review, you have an interface, which is essentially a contract, and the purpose is to bind things together to some extent. The relationship between classes and interfaces is that it "can be used as follows," so a Person reference variable can be used as a printable object, and also, likewise a Document reference variable can be used as a printable object.
Once you have an interface when you implement it, the members have to be implemented or you're going to get an error. IPrintable objects will be underlined in red. With this in place, you can then make objects of the type IPrintable, and you can make lists that store printable objects and other things.
The complete version of Default.aspx.cs for this lesson, including ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access