7. Object-Oriented Programming

Image

7.1 Single Implementation Inheritance

Inheritance is one of the fundamental mechanisms for code reuse in object-oriented programming (OOP). It allows new classes to be derived from existing ones. The new class (also called a subclass, subtype, derived class, or child class) can inherit members from the old class (also called a superclass, supertype, base class, or parent class). The subclass can add new behavior and properties and, under certain circumstances, modify its inherited behavior.

In Java, implementation inheritance (also known as class inheritance) is achieved by extending classes (i.e., adding new fields ...

Get A Programmer’s Guide to Java® SE 8 Oracle Certified Associate (OCA) 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.