CHAPTER 16

image

Inheritance

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 in your code
  • 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

What is Inheritance?

Sometimes you may need the same functionality at multiple places in your application. There are different ways to write code to achieve this. One way is to copy the same code ...

Get Beginning Java 8 Fundamentals: Language Syntax, Arrays, Data Types, Objects, and Regular Expressions 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.