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 is the function of static in java?
How to change the priority of thread or how to set priority of thread?
Is 0 true or false in java?
What is int lol?
What is the purpose of the main method?
Why main method is static in java?
What is difference between add() and addelement() in vector?
What are field variable and local variable?
what is an objects lock and which objects have locks? : Java thread
How many bytes is double?
If try block is successfully executed, Then Is Finally block executed?
what is an virtual function