Chapter 7. Polymorphism and Some Final Object Concepts

Earlier in this book, we introduced three key mechanisms that are required of an object-oriented programming language (OOPL). We already discussed how the C# language implements two of these concepts.

By way of review:

  • We can create our own user-defined types, also known as classes, to model objects of arbitrary complexity, as we discussed in Chapter 3.

  • We can arrange these types into class hierarchies to take advantage of the inheritance mechanism of OO languages, as we discussed in Chapter 5.

This chapter introduces the third essential OOPL feature, known as polymorphism, which simplifies code maintenance by allowing different objects belonging to different calls to respond to the same ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.