Why Java Provides Garbage Collector ?

In Java, there are no pointers. Memory management and allocation is done by JVM. Since memory allocation is automated, after some time JVM may go low on memory. At that time, JVM has to free memory from unused objects. To help with the process of reclaiming memory, Java provides an automated process called Garbage Collector.



You May Interest

What are the Differences Between Comparable and Comparator in Jav ...

What is the Difference Between pass by reference and pass by valu ...

What is the Use of a Dictionary Class in Java ?

Java How To Find The Average Of 10 Numbers Using A While Loop

What are the Similarities Between HashSet and HashMap in Java ?