Lesson 10
I am Your Father
Chapter 2: Inheritance
Introduction to Inheritance
In Lesson 9, you have looked at different ways objects can interact with each other.
In this chapter, we will look at yet another kind of relationship between objects called inheritance.
Let’s start with a video introducing the whole concept of inheritance!
Summary:
- Inheritance represent a generalisation relation between objects (A
Hunter
is a type ofCharacter
). - Inheritance allows you to reuse and extend objects without having to rewrite everything from scratch.