Inheritance

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

12 Terms

1
New cards

Inheritance

A way to create a relationship amongst classes.

2
New cards

Inheritance Hierarchy

A way to determine how information travels amongst the classes.

3
New cards

Superclass

The parent class from which other classes inherit.

4
New cards

Subclass

The classes that inherit from the superclass. They are more specific compared to the parent class.

5
New cards

Overridden method

When one version of a method is replaced by another version.

6
New cards

Polymorphism

When many classes are related to each other by inheritance, allowing different tasks to be performed using inherited methods.

7
New cards

Can a subclasses inherit public instance variables from its superclass?

Yes

8
New cards

Can a subclasses inherit private instance variables from its superclass?

No

9
New cards

Can a subclasses inherit public methods from its superclass?

Yes

10
New cards

Can a subclasses inherit private methods from its superclass?

No

11
New cards

What keyword do you use in the class header to specify the superclass for the subclass you are creating?

extends

// for example:
public class Subclass extends Superclass{}
12
New cards

What does super() mean in the constructor of a subclass?

It calls the constructor of the superclass.