What is the purpose of garbage collection?

A Removes object with many reference
B Removes object with reference
C Removes object with invalid reference
D Removes object with no reference

Correct Answer: Removes object with no reference

When the interpreter sees an object in the heap with no object references, it removes that object from the heap. This is called garbage collection. An object is considered garbage collectible if there are zero references pointing at this object.

Related Questions

Select from the options, the pair having a similar relationship to the first pair: Noisome : Garbage : :

Next steps