Tricky Little finalize() Golgotha\'s

Tricky Little finalize() Golgotha\'s

We have two concepts for the finalize() method  which is following here:
  1. For any given object, finalize() will be called only once by the garbage collector.
  2. Calling finalize() can actually result in saving an object from deletion.

firstly we know that the when we put any code in the normal method we can put this code in the finalized method.We could write code that passes a reference to the object in question back to another object, effectively unintelligible the object for garbage collection.

The garbage collector, however, will remember that, for this object, finalize() already ran, and it will not run finalize() again.


By:umang
Date:2014-03-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related scjp1.5 chap8 Links

scjp1.5 chap8 interview questions and answers for experienced and fresher