Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to use finalize()Method to resources

Answer Posted / nidhi

finalize is the method called(if defined) by garbage
collector just before it calls any object for garbage
collection. You are never sure that when will it be called.
The main aim for defining this method is to release the
resources that the object is holding before the object
could be deleted from the memory. If this method is called
then the object is not deleted from the memory in that
particular run of garbage collection but is deleted in the
next run.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you classify Dialog Box?

1176


What is a default constructor and also define copy contrucyor?

1161


What is the difference between the file and randomaccessfile classes?

1159


What about static nested classes in java?

1189


what are different ways in which a thread can enter the waiting state? : Java thread

1011


Can you explain the final method modifier?

1059


Explain naming conventions for packages?

1086


What is the base class in java from which all classes are derived?

1032


Explain what access modifiers can be used for methods?

1120


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1165


What is a top level class in java?

1086


Why static functions are used?

1143


Is stringwriter thread safe?

1048


If two threads have same priority which thread will be executed first ?

1571


What is immutable class in java?

1002