Multiple choice

What is garbage collection?

  1. The process of negating methods from a super class.

  2. The process of restoring orphaned objects.

  3. The process of de-allocating memory automatically.

  4. The process of creating a new object.

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

Garbage collection in Java is an automatic memory management process that identifies and discards objects that are no longer needed by the application, thereby freeing up memory resources. This prevents memory leaks without requiring manual de-allocation by the developer.