Skip to content

Inheritance: extends, super, and overriding

Handout

Inheritance: building on a class

  • Inheritance lets one class reuse another class's fields and methods.
  • The class you build on is the superclass (parent); the new class is the subclass (child).
  • A subclass is-a kind of its superclass: a Dog is an Animal.

An Animal superclass; Dog and Cat each extend it and override speak()

Handout

Log in or create account

IGCSE & A-Level