10 - Polymorphism Flashcards

1
Q

Polymorphism

A

having many forms

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

A polymorphic reference is a …

A

reference variable that can refer to different types of objects at different points in time.

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

The binding of a method invocation to its definition is performed at …

A

run time for a polymorphic reference. Also called late binding, or dynamic binding.

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

A reference variable can refer to…

A

any object created from any class related to it by inheritance.

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

What is used to determine which version of a method to invoke?

A

The type of the object, not the type of the reference

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

An interface name can be used to declare…

A

an object reference variable.

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

An interface reference can refer to any

A

object of any class that implements that interface.

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

A parameter to a method can be …

A

polymorphic, giving the method flexible control of its arguments.

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

How does the selection sort algorithm sort?

A

The selection sort algorithm sorts a list of values by successively putting particular values in their final, sorted positions.

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

Implementing a sort algorithm polymorphically….

A

allows it to sort any comparable set of objects.

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

Comparable

A

is an interface that includes only one method, compareTo which is designed to return an integer that is less that zero, equal to zero, or greater than zero if the executing objects is less than, equal or greater to the object its being compared.

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

Polymorphism allows us to apply a …

A

consistent approach to inconsistent behaviors.

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