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

What do you mean by access modifier?

1034


Compare overloading and overriding?

1005


What is the formula to calculate percentage?

1018


Does java list allow null?

997


Why are there no global variables in java?

1045


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

1040


what is meant by encapsulation?

1085


Which is better list or arraylist in java?

872


What is meant by oops concept in java?

998


Which list does not allow duplicates in java?

943


What is difference between word and integer?

1079


What is vector?

1068


Write a code to create a trigger to call a stored procedure

980


Difference between final and effectively final ?

1109


How transient variable is different from volatile variable?

1086