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

Enlist few advantages of inheritance?

0 Answers  


Which one of the following suits the description of a string better: derived or primitive?

0 Answers  


What is the difference between array and array list in java?

0 Answers  


What happens when a main method is declared as private?

22 Answers   DELL, Infosys, L&T, Sun Microsystems,


Is it possible to use string in the switch case?

0 Answers  






What is singletonlist in java?

0 Answers  


Is it possible to instantiate the abstract class?

0 Answers  


what is difference between length and length()?

8 Answers  


What is the difference between getCodeBase and getDocumentBase methods?

1 Answers   CS Business Services,


Can a class be a super class and a sub-class at the same time? Give example.

1 Answers  


How do u pass data from one jsp to another jsp?

3 Answers   Fidelity,


Why java does not supports multiple inheritance?

3 Answers   TCS, VSoft,


Categories