Inheritance

studied byStudied by 131 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 11

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

12 Terms

1

Inheritance

A way to create a relationship amongst classes.

New cards
2

Inheritance Hierarchy

A way to determine how information travels amongst the classes.

New cards
3

Superclass

The parent class from which other classes inherit.

New cards
4

Subclass

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

New cards
5

Overridden method

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

New cards
6

Polymorphism

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

New cards
7

Can a subclasses inherit public instance variables from its superclass?

Yes

New cards
8

Can a subclasses inherit private instance variables from its superclass?

No

New cards
9

Can a subclasses inherit public methods from its superclass?

Yes

New cards
10

Can a subclasses inherit private methods from its superclass?

No

New cards
11

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{}
New cards
12

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

It calls the constructor of the superclass.

New cards
robot