Chapter 12

Superclasses and Subclasses

Inheritance is a very important feature of object-oriented programming. Inheritance is a mechanism that allows one class to inherit the behaviors and attributes from another class. Inheritance allows you to create a hierarchy of classes. Thus, it has a direct impact on the design of your programs.

To represent a hierarchy, you can create a class that defines characteristics common to a group of objects. Using inheritance, this class can then be inherited by other classes which are more specific.

In this chapter you will learn about inheritance, its mechanisms and applications.