Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 4.13 Inheritance

Description

In this lesson, students learn about class hierarchy and make subclasses and superclasses. Class hierarchy is a critical part of the Java language and used to help reuse code between classes.

Students will explore the relationships of classes in this lesson and then extend that to class design in the next lesson.


Objective

Students will be able to:

  • Describe the differences between a Is A and a Has A relationship.
  • Explain how class hierarchy helps to reuse code.
  • Create subclasses
  • Explain that the Object class is the top of the Java hierarchy
  • Demonstrate how a subclass makes a call to the superclass constructor