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
Write code to implement bubble sort in java?
How does java enable high performance?
Do you know how to reverse string in java?
What is the difference between logical data independence and physical data independence?
do I need to use synchronized on setvalue(int)? : Java thread
What is equals method in java?
Name and explain the types of ways which are used to pass arguments in any function in java.
Can we instantiate interface in java?
What is the difference between the final method and abstract method?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
What is exception hierarchy in java?
What is the meaning of immutable regarding string?
Is void a wrapper class?
Which is better stringbuffer or stringbuilder?
Is map ordered in java?