As we learned in the previous lesson, the Object class is the superclass of all other classes in Java and resides in the java.lang package, so you never need to import it explicitly. Every class you write automatically extends Object, which means it inherits a basic set of behaviors—like memory management hooks and default implementations of common methods. Because it’s the root of the class hierarchy, features like garbage collection and synchronization ultimately trace back to methods defined in Object.
Back to Inheritance (NOT REQUIRED)
Lesson PreviewLesson 7 of 7 in this unit
9.7 EXTRA: object Superclass
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.
In this unit
7 lessons
- 9.1EXTRA: Creating Superclasses and SubclassesPreview lesson
- 9.2EXTRA: Writing Constructors for SubclassesPreview lesson
- 9.3EXTRA: Overriding MethodsPreview lesson
- 9.4EXTRA: super KeywordPreview lesson
- 9.5EXTRA: Creating References Using Inheritance HierarchiesPreview lesson
- 9.6EXTRA: PolymorphismPreview lesson
- 9.7EXTRA: object SuperclassThis lesson
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.