What is the purpose of garbage collection in Java, and when is it used? Ans. 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. - Study24x7
Social learning Network
09 Nov 2023 10:06 AM study24x7 study24x7

What is the purpose of garbage collection in Java, and when is it used? Ans. 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 coll...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles