0 votes
in JAVA by
What is the purpose of garbage collection in Java, and when is it used?

1 Answer

0 votes
by

The purpose of garbage collection is to identify and discard those objects that are no longer needed by the application, in order for the resources to be reclaimed and reused.

Related questions

+1 vote
asked Jan 24, 2020 in JAVA by rahuljain1
+1 vote
asked May 5, 2021 in JAVA by SakshiSharma
...