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...

What is the purpose of finalization?

Answer Posted / ranganathkini

Finalization is a facility provided by Java for classes who
use native resources to clean up before the objects are
garbage collected.

Since native resources or allocations are beyond the control
of Java's garbage collector, the responsibility of cleaning
up that native allocations falls on the object's
finalization code which shud ideally initiate quick clean up
operations and free any native memory it has allocated.

If finalization is not done, then the native resources wud
be left in the memory even after thier related Java
instances have been removed by the Java's GC. Hence it is an
invaluable feature.

But it needs to be used with caution as finalization
consumes more processing by Java

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a loop java?

1062


What is byte data type?

1005


What differences exist between iterator and listiterator?

1049


What should I import for arraylist in java?

1043


What is a "pure virtual" member function?

1101


What is variable argument in java?

1012


What is an interoperable application in java ?

1012


When is the finalize() called? What is the purpose of finalization?

1080


What is nullpointerexception?

1075


How do you remove duplicates from an array in java?

960


What is assembly condition codes?

993


Write a program to reverse array in place?

1072


What is passing parameters in java?

1044


What is meant by structural programming?

1022


Can we make a constructor final?

1023