ABSTRACT

In science, inheritance is a mechanism for organizing knowledge into hierarchies. In object-oriented computer languages, such as Java, inheritance is implemented by means of a class hierarchy in which one class, usually called the derived class, inherits the data members and the functionality of another one, usually called the base class or the superclass. In short, inheritance makes it possible for an object of a subclass to contain the attributes and properties of the superclass. This mechanism makes it easier to develop software by avoiding duplication and improving the organization of the knowledge base. It also makes programs more reliable and easier to extend and to repair. In this chapter we look at class inheritance in Java code and how inheritance promotes a higher level of abstraction.