Can try statements be nested?
Answers were Sorted based on User's Feedback
Answer / manikandansit
yes we can.
class test
{
public static void main(String []adsfdasf)
{
try
{
try
{
}catch(Exception e)
{
}
}catch(Exception e)
{
}
}
}
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / devarathnam
Hi... yes ,"try" statements can be nested, but each try
must be having the one "catch" statement.Without "catch"
and "finally" statements ,"try" statement will be illegal
| Is This Answer Correct ? | 7 Yes | 0 No |
What are the different types of multitasking?
Difference between nested and inner classes ?
What is slash r?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
how to compile jsp?
Difference between ‘>>’ and ‘>>>’ operators in java?
Is intellij better than eclipse?
what is the difference between sleep() and Wait()?
What is an anonymous class in java?
Where we write javascript code in html page?
What is the use of parse function in java?
Can we have static methods in an interface?