what are the rules to use try catch finally?



what are the rules to use try catch finally?..

Answer / 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

More Core Java Interview Questions

What is a get method?

0 Answers  


Is java se free?

0 Answers  


What are the differences between wait() and sleep()?

0 Answers  


What is string substring?

0 Answers  


What is serialization in java?

0 Answers  






why static class in java or what is use of static class in java

3 Answers   SunGard,


What is class and its types?

0 Answers  


Which is better ascii or unicode?

0 Answers  


Can inner class have constructor?

0 Answers  


Define the term string pool?

0 Answers  


What is a method declaration?

0 Answers  


What is difference between iterator access and index access?

0 Answers  


Categories