Friday 15 March 2013

What is garbage collection?

What is garbage collection? 
Garbage collector: Whenever an object is no longer used in the program, Java reclaims the memory of that object. It is performed by the Java implicitly, no need to care of it. Finalize() will be called before sweeps the memory of an object by java. Java does not support destructor, so we will use Garbage collector in the place of destructor.
Garbage Collector :Whenever an object is no longer needed in the java program. Java provides the machenisam for free-up memory space taken by objects. This is known as garbage collection.


Blog Author: Vijay Kumar

Go to: Coding Problem Solutions

No comments: