6.1. Inheritance with classes

[7.1] Describe inheritance and its benefits

[7.5] Use abstract classes and interfaces

When we discuss inheritance in the context of an object-oriented programming language such as Java, we talk about how a class can inherit the properties and behavior of another class. The class that inherits from another class can also define additional properties and behaviors. The exam will ask you explicit questions about the need to inherit classes and how to implement inheritance using classes.

Let’s get started with the need to inherit classes.

6.1.1. The need to inherit classes

Imagine the positions Programmer and Manager within an organization. Both of these positions have a common ...

Get OCA Java SE 8 Programmer I Certification 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.