Inheritance

This third and final chapter on object-oriented programming covers inheritance, the ability to specify that a class is "just like that other one, except ...." Section 3.1 explains how and when to create a subclass that inherits code from the class it extends. The Object class, from which all other classes are ultimately derived, is described in Section 3.2. Section 3.3 discusses packages (collections of classes) and access levels, which give us finer control over who can see which parts of our classes.

Extending a Class

Категории