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
Can main() method in java can return any data?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
hr interview how many minutes asking question
How do you join strings in java?
When should I use singleton?
What is final access modifier in java?
Write a program to find maximum and minimum number in array?
What is an iterator java?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
Explain the scope or life time of class variables or static variables?
What is the difference between an interface and an abstract class?
What is a type parameter in java?
What is the difference between an if statement and a switch statement?
What is the difference between pass by reference and pass by pointer?
What is meant by binding in rmi?