Multiple choice

Which of the following methods is called by the garbage collector when it determines that there are no more references to the object?

  1. final()

  2. finalize()

  3. collector()

  4. collection()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The finalize() method is called by the garbage collector when it determines that there are no more references to the object. The return type of finalize() method is protected void.