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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a break statement and a continue statement?

1034


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

1104


what is the volatile modifier for? : Java thread

996


Can we create an object of static class in java?

1016


What is ‘is-a ‘ relationship in java?

1026


What is the java reflection api? Why it’s so important to have?

980


Add a value x to array from index l to r where 0 <= l <= r <= n-1

1093


How is garbage collection controlled?

1171


Can we start a thread twice in java?

985


What is functional interface in java?

1045


What is the use of protected in java?

1025


What is the purpose of garbage collection in java? When is it used?

1048


What is generic type?

1028


What are the differences between include directive and include action?

1189


Difference between class#getinstance() and new operator ?

1206