Back to Inheritance (NOT REQUIRED)

Lesson PreviewLesson 4 of 7 in this unit

9.4 EXTRA: super Keyword

Part of Inheritance (NOT REQUIRED) in AP® Computer Science A. Read the opening section, then create a free account for the full interactive lesson, practice, and progress tracking.

When a class extends another class, it inherits methods and variables from its parent. But what if you need to access or use something from the parent class directly? That's where the super keyword comes in.

The super keyword allows you to call methods or access variables that belong to the parent (superclass). Think of it like a direct phone line to your parent class. There are two main ways to use the super keyword: calling a parent constructor or accessing parent methods or variables.

Continue the full lesson in Stellar

Create a free account to unlock the remaining sections, checkpoints, course practice, and progress tracking for AP® Computer Science A.