Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Lesson 9.5 Creating References Using Inheritance

Description

In this lesson, students will create references using inheritance hierarchies. An object can take on different forms depending on its implementation. Java can call the correct method even when an object is disguised as a more generic reference type. This is known as polymorphism. This lesson corresponds with AP Computer Science A topic 9.5.


Objective

Students will be able to:

  • Define reference variables of a superclass to be assigned to an object of a subclass in the same hierarchy

Enduring Understandings

This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…

  • EU Mod-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. (LO’s 3.B, 3.C)