What is the primary purpose of garbage collection in Java?

  • Accelerating compilation
  • Enhancing network performance
  • Freeing up memory
  • Optimizing CPU usage
The primary purpose of garbage collection in Java is to free up memory by identifying and reclaiming the memory occupied by objects that are no longer reachable or in use.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *