Java OCA OCP Practice Question 388

Question

If an object with a finalize() method has been garbage collected, which of the following are true about that object?

  • A. The object became unreachable.
  • B. The object's finalize() method was invoked by the garbage collector.
  • C. The memory used by the object is subject to reuse.
  • D. The object did not implement any interfaces.


A, B, and C.

Note

Only unreachable objects are garbage collected.

If an object has a finalize() method, the garbage collector will invoke the object's finalize() method before garbage collecting the object.

After an object has become garbage collected, its memory is subject to reuse.




PreviousNext

Related