This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 2: Inheritance

Introduction to Inheritance

face Josiah Wang

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 of Character).
  • Inheritance allows you to reuse and extend objects without having to rewrite everything from scratch.