Garbage collection

Posted By on September 9, 2014


Download PDF
Constructors in java
The finalize() method

Since objects are dynamically allocated by using the new operator, you might be wondering how such objects are destroyed and their memory released for later reallocation.

In some languages, such as C++, dynamically allocated objects must be manually released by use of a delete operator .Java takes a different approach; it handles deallocation for you automatically.

The technique that accomplishes this is called garbage collection.It works like this: when no references to an object exist, that object is assumed to be no longer needed, and the memory occupied by the object can be reclaimed.

Garbage collection only occurs sporadically (if at all) during the execution of your program.you should not have to think about it while writing your programs.

Constructors in java
The finalize() method

Download PDF

Posted by Akash Kurup

Founder and C.E.O, World4Engineers Educationist and Entrepreneur by passion. Orator and blogger by hobby

Website: http://world4engineers.com