zuai-logo
zuai-logo
  1. AP Computer Science A
FlashcardFlashcardStudy GuideStudy Guide
Question BankQuestion Bank

Super Keyword

Ethan Taylor

Ethan Taylor

3 min read

Next Topic - Creating References Using Inheritance Hierarchies

Listen to this study note

Study Guide Overview

This study guide covers using the super keyword in Java to call superclass methods. It explains how super helps in method overriding/overloading by utilizing the superclass implementation. The guide provides an example with a Rectangle class illustrating super within the isEquivalent() method and the constructor.

When we talked about writing constructors for subclasses in Topic 9.2, we described how you can use the super keyword to invoke constructor in the superclass. As we'll learn in this topic, we can also use the super keyword to call on methods from the superclass.

#Super for Methods

Sometimes when we are overriding or overloading a method, we want to borrow the superclass’s implementation of tha...

Feedback stars icon

How are we doing?

Give us your feedback and let us know how we can improve

Previous Topic - Overriding MethodsNext Topic - Creating References Using Inheritance Hierarchies

Question 1 of 3

How do you call a method from the superclass within a subclass using the super keyword? 🤔

super().methodName();

super.methodName();

this.super.methodName();

superclass.methodName();