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

State differences between C and Java?

1264


Mention the default values of all the elements of an array defined as an instance variable.

1036


What are the five major types of reference sources?

1192


What is Java Reflection API? Why it’s so important to have?

1242


How many bits is a string in java?

1076


How many characters is 16 bytes?

1046


Explain about features of local inner class?

1186


What is this keyword used for?

1181


How will you invoke any external process in java?

1160


why not override thread to make a runnable? : Java thread

1059


Is there a way to increase the size of an array after its declaration?

1086


Is assembly language a low level language?

1017


How to instantiate static nested classes in java?

1133


Explain the differences between static and dynamic variables?

1198


What is meant by class loader? How many types are there? When will we use them?

1008