© Kishori Sharan and Adam L. Davis 2022
K. Sharan, A. L. DavisBeginning Java 17 Fundamentalshttps://doi.org/10.1007/978-1-4842-7307-4_20

20. Inheritance

Kishori Sharan1   and Adam L. Davis2
(1)
Montgomery, AL, USA
(2)
Oviedo, FL, USA
 
In this chapter, you will learn:
  • What inheritance is

  • How to inherit a class from another class

  • The difference between early binding and late binding

  • What method overriding is and how to override methods

  • What field hiding and method hiding are and how to use them

  • What abstract classes are and where to use them

  • How to declare final classes and methods

  • The difference between “is-a,” “has-a,” and “part-of” relationships

  • How to use pattern matching for classes

  • How to use sealed classes

All example programs in this chapter are a member ...

Get Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 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.