- Information
- AI Chat
Was this document helpful?
AP Computer Science A Notes
Topic: Unit 9: Inheritance
Subject: AP Computer Science A
814 Documents
Students shared 814 documents in this course
Level:
AP
Was this document helpful?
AP Computer Science A Notes:
Inheritance defines a relationship between _______ that share characteristics
objects
Inheritance is when a new class (_______) is created from an existing class (_______)
subclass, superclass
The subclass _______ characteristics of its superclass
inherits
When methods of superclasses are overwritten by subclasses
Method overriding
If part of the original method implementation from the superclass is retained, the rewrite is
referred to as _______
Partial overriding
Interfaces are implemented using what keyword?
Implements
True or false: A class that extends a superclass can also implement an interface.
true
When a class extends a superclass AND implements an interface, which clause comes first?
the extends clause
True or false: A class can have just one superclass.
True
True or false: A class can only have one interface.
False
An (interface/abstract class) typically does NOT provide implementations for any of its methods,
while an (interface/abstract class) can.
interface; abstract class
What methods of Object are important to know? (2)
toString; equals
What does the default toString() return?
the class name, an @, and the memory address of the object
Why should you redefine the toString method for all of your classes?