Quiz #3
Wednesday
With a piece of paper, write down your name and answers to the following questions.
Making an instance of one class a field in another class is called:
- Nesting
- Class Fielding
- Aggregation
- Concatenation
What
enum
method returns the position of anenum
constant in the declaration?position
toString
location
ordinal
What is the name of the process, performed periodically by the JVM, that automatically removes unreferenced objects from memory?
- Memory Cleansing
- Memory Deallocation
- Garbage Collection
- Object Expungement
Is it necessary to override the
toString
method of anenum
class in order to obtain a string representation of the name of anenum
constant?Answer: No, it is not necessary.
What is the output of the following program?