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

What is a Presistent Object?

642


Are floats faster than doubles?

566


What is command line argument

710


Why stringbuffer is faster than string?

541


what type of questions asked for barclays technologies pune please send urgent

5230






State two differences between C and Java.

695


How do you do absolute value in java?

523


What is member in java?

494


What is the tradeoff between using an unordered array versus an ordered array?

661


Tell me about different OOPS concepts.

592


Difference between ‘>>’ and ‘>>>’ operators in java?

641


Why there are some null interface in java? What does it mean?

644


What are the differences between c++ and java?

582


Which arithmetic operations can result in the throwing of an arithmeticexception?

597


What is the do while loop syntax?

553