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 |
Iterator in the HashMap is fail-safe means what?
What methods are used to get and set the text label displayed by a button object?
Can we have return statement in finally clause? What will happen?
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?
What are generic methods?
What is a classloader in java?
What method is used to know the status of Checkbox(i.e it is checked or unchecked)?
What is singleton class in java and how can we make a class singleton?
How large is a boolean?
What is tree node in java?
How to create a custom exception?
Can an anonymous class be declared as implementing an interface and extending a class in java programming?