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 |
What is the difference between sleep and wait in java?
What about member inner classes?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Why arraylist is used in java?
What is canonical name in java?
What kind of variables a class can consist of?
Can you give few examples of final classes defined in java api?
What is the difference between object oriented programming language and object based programming language?
How concurrent hashmap works?
What is the difference between public, private, protected, and friend access?
What is the difference between declaration and definition in java?
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.