CMPS 280 Exam 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Describe the Tail Recursion type.

A

There is no code after the recursion call

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

Describe the Non-Tail Recursion type.

A

There is code after the recursion call.

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

Describe the Indirect Recursion type.

A

Method calls another method, which eventually calls original method again.

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

What is the toString() method?

A

Returns a string representation of the object.

Automatically gets called when you print out the reference to the object.

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

What is polymorphism?

A

Poly, meaning many, and Morphism meaning change.

A reference of a parent can refer to ANY of it’s children, grandchildren, etc.

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

What is encapsulation?

A

allow controlled access to private attributes via public methods.

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

A class in Java can inherit from (extend)…

A

Exactly one parent class

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

What is an Object?

A

(in java) is at java’s hierarchy top and so it can refer to anything.

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