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

Why we need Finally with try?
pls expain with ur example..

Answer Posted / neha

finally block gets executed in both scenarios I.e exception occurs or doesn't occur..it is used to write the code which we want to execute in both successful or failed scenarios..generally code for cleaning up resources added in finally block.e.g closing file,closing socket connection.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we clone singleton object?

1042


Is main a keyword in java?

942


Explain the difference between call by refrence and call by value?

1008


Is set thread safe java?

901


Where are variables stored?

952


Explain the difference between hashmap and hashtable in java?

930


What is autoboxing in java?

1045


What is hashtable and explain features of hashtable?

969


What is dynamic array in java?

1007


Does a class inherit the constructors of its superclass in java programming?

1082


What is operator overloading. Is it is supported in java?

1000


What are scriptlets?

1073


Why does it take so much time to access an applet having swing components the first time?

1913


Why set do not allow duplicates in java?

1070


What is use of valueof () in java?

1034