Final answer:
Garbage collection in Java refers to the automatic memory management feature of the JVM that reclaims the memory used by objects that are no longer needed. The correct answer is that it happens when all references to an object are gone.
Step-by-step explanation:
Garbage collection in the context of Java is the process by which the Java Virtual Machine (JVM) automatically reclaims memory that is no longer in use. When an object in Java is created, it occupies a certain space in the memory. Once an object is no longer needed, for instance, when all references to it are lost, the garbage collector steps in to clear this memory, making it available for new objects.
Therefore, in the context of the options provided, the correct answer is (c): 'When all references to an object are gone, the memory used by the object is automatically reclaimed.' This method of memory management helps in preventing memory leaks and ensures more efficient use of system resources.