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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.