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 Overriding and how can it be used?

7 Answers   Consagous, Wipro,


What is arraylist e?

0 Answers  


What is a boolean structure?

0 Answers  


What is meant by object?

0 Answers  


What is a treeset class?

0 Answers  






How do you create a sop?

0 Answers  


What is the unit of plancks constant?

0 Answers  


Can an abstract class be final?

10 Answers  


what is the replacement for GOTO in java?

2 Answers   CTS,


extending thread class or implementing runnable interface. Which is better? : Java thread

0 Answers  


Explain public static void main(string args[]) in java.

0 Answers  


Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?

1 Answers  


Categories