Quiz #3


With a piece of paper, write down your name and answers to the following questions.

  1. Making an instance of one class a field in another class is called:

    1. Nesting
    2. Class Fielding
    3. Aggregation
    4. Concatenation
  2. What enum method returns the position of an enum constant in the declaration?

    1. position
    2. toString
    3. location
    4. ordinal
  3. What is the name of the process, performed periodically by the JVM, that automatically removes unreferenced objects from memory?

    1. Memory Cleansing
    2. Memory Deallocation
    3. Garbage Collection
    4. Object Expungement
  4. Is it necessary to override the toString method of an enum class in order to obtain a string representation of the name of an enum constant?

    Answer: No, it is not necessary.

  5. What is the output of the following program?