02 Inheritance and Polymorphism Flashcards

1
Q

attribute

A

fact associated with a specific object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A ___ inherits all the features of the class it is based on

A

subclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The terms derived class and child class are different names for

A

subclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The terms base class and parent class are different names for

A

superclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

a special kind of method that is used to initialize a brand new object.

A

a constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

note1

A

A computer is a tool that can be used to implement a plan for solving a problem.

A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan.

An algorithm is a plan for solving a problem.

A person must design an algorithm.

A person must translate an algorithm into a computer program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

a process for developing a detailed algorithm by gradually adding detail to a high-level algorithm.

A

stepwise refinement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The name of a method should be

A

a verb or a short verb phrase that describes what the method does

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

An __ relationship exists between a subclass and its superclass, since every instance of the subclass is also an instance of the superclass at the same time.

A

is-a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

note2

A

Every time you create a subclass, you are responsible for defining all of the constructors it supports. Constructors are not inherited from superclasses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Polymorphism

A

different receivers can respond to the same method call in different ways.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly