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 are the rules to use try catch finally?

Answer Posted / naveen

Rules to using try catch finally blocks.

First thing is try,catch and finally blocks are used in
Exception Handling.In try block we are write Exception
rising code in catch block using exception handling code and
finally block is used to releasing the resource. try and
catch blocks are executed are not finally block is executed.
we are using this combination

try{
//Exception rising Code
}catch(Exception e){

}finally{
//releasing the resource
}

2)
try{
//Exception rising Code
}catch(Exception e){

}

3)try{
//Exception rising Code
}finally{
//releasing the resource
}

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you declare the main method as final?

966


How can an exception be thrown manually by a programmer?

937


Can we convert list to set in java?

926


What is the difference between preemptive scheduling and time slicing?

1009


Why is multiple inheritance not supported in java?

972


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

1118


Is break statement can be used as labels in java?

920


What is singleton class in java and how can we make a class singleton?

1085


Can a java program have 2 main methods?

1004


What is default size of arraylist in java?

1078


How will you initialize an Applet?

1092


What restrictions are placed on method overloading?

1130


How we can skip finally block of exception even if some exception occurs in the exception block in java?

884


Define max and min heap, also the search time of heap.

992


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

939