CMPS 280 Exam 2 Flashcards
Describe the Tail Recursion type.
There is no code after the recursion call
Describe the Non-Tail Recursion type.
There is code after the recursion call.
Describe the Indirect Recursion type.
Method calls another method, which eventually calls original method again.
What is the toString() method?
Returns a string representation of the object.
Automatically gets called when you print out the reference to the object.
What is polymorphism?
Poly, meaning many, and Morphism meaning change.
A reference of a parent can refer to ANY of it’s children, grandchildren, etc.
What is encapsulation?
allow controlled access to private attributes via public methods.
A class in Java can inherit from (extend)…
Exactly one parent class
What is an Object?
(in java) is at java’s hierarchy top and so it can refer to anything.