Here we are providing interview questions which are related to java / j2ee. Give your comments and make it helpful to all.For JAVA videos visit http://www.sharmanj.com/allvideos.html
Friday, July 30, 2010
About java finalize() method ?
Its a method defined in Object(Which is a base class of all the classes) class. Java dont have destructors instead it uses finalize() method. finalize() method not guarantee to run. For any given object finalize() method will be called only once by the garbage collector. Calling finalize() method can actually result in saving an object from deletion. If finalize() method contains the code of assigning a reference so that the object is not eligible for Garbage Collector. The second time the garbage collector will delete it. Because finalize() method run only one time for a given object.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment