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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.