In this lesson, students will learn about superclasses and subclasses. A superclass is a parent class that contains common attributes and behaviors used by subclasses (children). Subclasses can draw upon the existing attributes and behaviors of the superclass without repeating these in the code. This lesson corresponds with AP Computer Science A topic 9.1.
Students will be able to:
In this lesson, students will write constructors for subclasses. The superclass constructor can be called from the first line of a subclass constructor by using the keyword super and passing appropriate parameters. This lesson corresponds with AP Computer Science A topic 9.2.
Students will be able to:
In this lesson, students will learn how to override methods in a superclass/subclass relationship. Method overriding occurs when a public method in a subclass has the same method signature as a public method in the superclass. This lesson corresponds with AP Computer Science A topic 9.3.
Students will be able to:
In this lesson, students will use the super
keyword. This keyword can be used to call a superclass’s constructors and methods even if the method has been overridden. This lesson corresponds with AP Computer Science A topic 9.4.
Students will be able to:
super
keyword to call a superclass’s constructors and methodsIn 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.
Students will be able to:
This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…
In this lesson, students will take a deeper dive into Polymorphism. At compile time, methods in or inherited by the declared type determine the correctness of a non-static method call. At run-time, the method in the actual object type is executed for a non-static method call. This lesson corresponds with AP Computer Science A topic 9.6.
Students will be able to:
In this lesson, students will call and use the Object superclass. The Object class is the superclass of all other classes in Java. This lesson corresponds with AP Computer Science A topic 9.7.
Students will be able to: