The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.
A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.
Liked By
Write Answer
What is the purpose of garbage collection in Java, and when is it used?
Join MindStick Community
You have need login or register for voting of answers or question.
Sumit Kesarwani
23-Aug-2014The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.
A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.