OCP EXAM OBJECTIVES COVERED IN THIS CHAPTER:
- Reusing Implementations Through Inheritance
- Create and extend abstract classes
- Programming Abstractly Through Interfaces
- Create and implement interfaces
- Distinguish class inheritance from interface inheritance including abstract classes
In Chapter 8, “Class Design,” we showed you how to create classes utilizing inheritance and polymorphism. In this chapter, we will continue our discussion of class design starting with abstract classes. By creating abstract class definitions, you’re defining a platform that other developers can extend and build on top of. We’ll then move on to interfaces and show how to use them to design a standard set of methods across classes ...