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?

Answers were Sorted based on User's Feedback



What is the purpose of finalization?..

Answer / ravikiran

finalization is the process of conserving the resources
before garbage collection

Is This Answer Correct ?    6 Yes 0 No

What is the purpose of finalization?..

Answer / sandeep

While exception handling if exception is thrown programme
will abort abnormally but it can leads to some problamatic
situation..hence we have to ensure some code will always run
whtever happen..finalization does so. Some useful tasks that
we have to do ( cleaning up some resources or closing some
connection or socket etc) we can gurantee it will be done by
simply putting it in finally block.

It will run always (Unless System.exit() is not called) and
hence future problem can be handled.

Is This Answer Correct ?    7 Yes 2 No

What is the purpose of finalization?..

Answer / 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

What is the purpose of finalization?..

Answer / srikanth reddy

The purpose of finalization is to give an unreachable
object the opportunity to perform any cleanup processing
before the object is garbage collected.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More Core Java Interview Questions

what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread

0 Answers  


How to use string tokenizer class.

0 Answers  


i need source code for income tax program using java inheritance

1 Answers  


What is private public protected in java?

0 Answers  


Write program to print Hello World and print each character address in that string and print how many times each character is in that string? Ex: H: 0 & 1 e:1 & 1 l :2,3,8 & 3 o:4,6 & 2 w:5 & 1 r: 7 & 1 d 9 & 1

7 Answers   Huawei, IBM,


What is charat ()?

0 Answers  


What do you mean by garbage collection used in java?

0 Answers  


What is double parsedouble in java?

0 Answers  


when to for abstract class and when to go for interface

2 Answers  


What is ResourceBundle class?

1 Answers  


What are green threads in java?

0 Answers  


What is meant by method overriding?

0 Answers  


Categories