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 a abstract class be declared final?

957


Which keyword specify that a variable is effectively final ?

946


In a class implementing an interface, can we change the value of any variable defined in the interface?

1034


how to deploy tomcatserver to weblogic server? write d following steps?

1923


What is tcp ip in java?

1072


What is an enumeration?

1016


Should a main method be compulsorily declared in all java classes?

1014


What is map java?

927


Write a java program for binary search?

1015


What is the byte order of byte buffer?

961


Explain different types of thread priorities ?

1050


Is string is a class in java?

910


What is unmodifiable list in java?

913


Does substring start with 0?

946


How many bits is a string?

958