WHAT IS THE PURPOSE OF GARBAGE COLLECTION IN JAVA, AND WHEN IS IT USED?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
Java 
 900  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is the purpose of garbage collection in Java, and when is it used?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!