In this chapter, you learned how to maximize code reuse by writing code capable of working with objects of different types, that is, instances of classes that conform to specific protocols or whose class hierarchy includes specific superclasses. We worked with protocols and generics. We created classes capable of working with one or two constrained generic types.
We combined inheritance, protocols, and extensions to maximize the reusability of code. We could make classes work with many different types.
Now that you have learned about parametric polymorphism and generics, we are ready to combine object-oriented programming and functional programming, which is the topic of the next chapter.