Can try statements be nested?

Answers were Sorted based on User's Feedback



Can try statements be nested?..

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

Can try statements be nested?..

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

Can try statements be nested?..

Answer / ashokmail.java@gmail.com

Yes

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the function of static in java?

0 Answers  


How to change the priority of thread or how to set priority of thread?

0 Answers  


Is 0 true or false in java?

0 Answers  


What is int lol?

0 Answers  


What is the purpose of the main method?

0 Answers  






Why main method is static in java?

0 Answers  


What is difference between add() and addelement() in vector?

0 Answers  


What are field variable and local variable?

3 Answers  


what is an objects lock and which objects have locks? : Java thread

0 Answers  


How many bytes is double?

0 Answers  


If try block is successfully executed, Then Is Finally block executed?

0 Answers   PUCIT,


what is an virtual function

2 Answers   TCS,


Categories