Chapter 9. Abstraction and inheritance

Abstraction and inheritance

9.1 Class power

9.2 Inheritance

9.3 Abstraction through interfaces

9.4 Abstract methods and classes

9.5 Case Study 4: Veterinary Tags

9.5 Serialization

Object-oriented programming has several ways in which the use of classes is made more powerful. We have already been using classes extensively for what is known as composition, in other words, creating an object in a class based on another class. An example of this would be the array of batches kept in the Coffee class. Two other concepts that we shall now study are abstraction and inheritance.

Class power

Abstraction

Abstraction enables a class or method to concentrate ...

Get Java Gently, Third Edition now with O’Reilly online learning.

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