Chapter 5Class Design

OCA exam objectives covered in this chapter:

  • correct Working with Inheritance
    • Describe inheritance and its benefits
    • Develop code that demonstrates the use of polymorphism; including overriding and object type versus reference type
    • Determine when casting is necessary
    • Use super and this to access objects and constructors
    • Use abstract classes and interfaces

In Chapter 1, “Java Building Blocks,” we introduced the basic definition for a class in Java. In Chapter 4, “Methods and Encapsulation,” we delved into constructors, methods, and modifiers, and showed how you can use them to build more structured classes. In this chapter, ...

Get OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808 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.