Home > DeveloperSection > Interviews > What is the purpose of garbage collection in Java, and when is it used?

Posted on    August-23-2014 6:05 AM

 Java Java 
Ratings:
 1 Answer(s)
  698  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Points:3910
Posted on    August-23-2014 12:00 AM

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.


Don't want to miss updates? Please click the below button!

Follow MindStick