AP Computer Science A 50 Flashcards Advanced 100% Free

AP Computer Science A:: Inheritance

Created by Chat Robotics Community  ·  Updated 2026-08-31

Curriculum Overview

Comprehensive, high-yield AP Computer Science A study deck focusing on Inheritance. Features 50 rigorous, curriculum-aligned flashcards designed for advanced-level mastery. Core concepts covered include What Java, key problem-solving heuristics, foundational formulas, and exam-tested application scenarios. Ideal for active recall review, spaced repetition study, and scoring in the top percentile.

Topics & Key Concepts

Java This Shape Animal METHOD Object Science ABSTRACT Computer Override

Sample Flashcard Questions & Answers

Showing 8 of 50 cards
Question #1 Active Recall

What is INHERITANCE in object-oriented programming?

- **A)** A mechanism where two classes share no relationship at all
- **B)** Copying and pasting a class's entire code into a new, unrelated class
- **C)** A mechanism where a new class (the SUBCLASS) is defined based on an EXISTING class (the SUPERCLASS), automatically gaining that superclass's instance variables and methods, while being able to add or override its own
- **D)** A synonym for encapsulation

Answer & Explanation:
**Answer: C)**

Inheritance lets a subclass reuse and extend a superclass's functionality, avoiding duplicated code between related classes.
Question #2 Active Recall

What Java keyword is used to declare that one class INHERITS from another, such as \(public\ class\ Dog\ extends\ Animal\)?

- **A)** \(implements\)
- **B)** \(super\)
- **C)** \(inherits\)
- **D)** \(extends\)

Answer & Explanation:
**Answer: D)**

\(extends\) is the specific keyword used to establish a class-to-class inheritance relationship in Java.
Question #3 Active Recall

In the relationship \(public\ class\ Dog\ extends\ Animal\), which class is the SUPERCLASS and which is the SUBCLASS?

- **A)** This relationship does not establish any superclass/subclass distinction
- **B)** \(Dog\) is the superclass, and \(Animal\) is the subclass (the reverse of the truth)
- **C)** Both classes are considered superclasses
- **D)** \(Animal\) is the SUPERCLASS (the more general, parent class), and \(Dog\) is the SUBCLASS (the more specific, child class)

Answer & Explanation:
**Answer: D)**

The class AFTER \(extends\) is always the superclass (parent), and the class being declared is the subclass (child) inheriting from it.
Question #4 Active Recall

What does a SUBCLASS automatically GAIN from its SUPERCLASS through inheritance?

- **A)** Only the superclass's \(private\) instance variables, nothing else
- **B)** The subclass replaces the superclass entirely, gaining none of its own identity
- **C)** The superclass's \(public\) and \(protected\) instance variables and methods (though NOT its \(private\) members, which remain inaccessible directly)
- **D)** Absolutely nothing; inheritance provides no automatic access to anything

Answer & Explanation:
**Answer: C)**

Inheritance gives the subclass access to the superclass's non-private members, while \(private\) members remain encapsulated within the superclass itself.
Question #5 Active Recall

What is the purpose of the \(super\) keyword when used to call \(super(...)\) as the FIRST line of a subclass's constructor?

- **A)** It deletes the superclass's version of the object
- **B)** It explicitly calls the SUPERCLASS's constructor, allowing the superclass's portion of the object's state to be properly initialized before the subclass's own constructor code runs
- **C)** \(super(...)\) can only be used inside a subclass's methods, never inside its constructor
- **D)** It creates an entirely separate, second object of the superclass

Answer & Explanation:
**Answer: B)**

Calling \(super(...)\) ensures the inherited (superclass) portion of an object is properly set up, typically before the subclass adds its own additional initialization.
Question #6 Active Recall

If a subclass's constructor does NOT explicitly call \(super(...)\), what does Java do automatically?

- **A)** Java automatically inserts an IMPLICIT call to the superclass's NO-ARGUMENT constructor as the very first statement, before the subclass's own constructor code runs
- **B)** Java calls the subclass's OWN constructor twice instead
- **C)** This causes a compile-time error in every case
- **D)** Java skips initializing the superclass portion of the object entirely

Answer & Explanation:
**Answer: A)**

This implicit call happens automatically UNLESS the superclass has no accessible no-argument constructor, in which case an explicit \(super(...)\) call becomes required.
Question #7 Active Recall

What is METHOD OVERRIDING, as distinguished from method OVERLOADING (Unit 5)?

- **A)** Defining multiple methods with the same name but different parameter lists within the SAME class
- **B)** Overriding and overloading are always exactly the same thing with no distinction
- **C)** Overriding requires the subclass method to have a DIFFERENT name from the superclass method
- **D)** A SUBCLASS providing its OWN implementation of a method that is already defined in its SUPERCLASS, using the EXACT SAME method signature (name and parameter list), to REPLACE (not add to) the inherited behavior

Answer & Explanation:
**Answer: D)**

Overriding (redefining an inherited method with an identical signature) is conceptually distinct from overloading (multiple methods, same name, different parameters, within one class) -- a very commonly confused pair of terms.
Question #8 Active Recall

What is the purpose of the \(@Override\) ANNOTATION placed above a method definition, such as: \(@Override\ public\ String\ toString()\ \{\ ...\ \}\)?

- **A)** \(@Override\) is required for a method to actually override anything -- without it, overriding does not occur at all
- **B)** \(@Override\) can only be used on constructors
- **C)** It tells the COMPILER that this method is INTENDED to override a superclass method, so the compiler can catch a mistake (like a typo in the method's name or parameters) that would otherwise silently create an unrelated new method instead
- **D)** \(@Override\) changes the method's return type automatically

Answer & Explanation:
**Answer: C)**

\(@Override\) is a helpful SAFETY CHECK (not a strict requirement for overriding to work), catching signature mismatches at compile time that would otherwise be silent, hard-to-find bugs.

Want to study all 50 flashcards with spaced repetition?

Practice with Anki-style scheduling, Hands-Free audio commute mode, and AI Tutor explanations.

Start Studying Full Deck Now

How You Can Study This Deck on Chat Robotics

Anki Spaced Repetition (SRS)

Algorithms schedule review intervals automatically so you retain 90%+ in minimum study time.

Hands-Free Audio Commute Mode

High-fidelity Neural Text-To-Speech reads questions and answers aloud with customizable delay timers.

Built-in AI Tutor Assistant

Stuck on a tricky concept? Click "Ask AI" on any card to receive instant deep-dive step-by-step explanations.

Subdeck & Tag Organization

Organize and filter by topic tags or drill entire subdeck hierarchies sequentially in Subdeck Scheduler.