Chapter 9Advanced Class Design

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 ...

Get OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide 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.