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 meant by object oriented programming – oop?

1 Answers  


In which order the iterator iterates over collection?

1 Answers  


What is the difference between @before and @beforeclass annotation?

1 Answers  


What code optimizations techniques you follow in general practice?

2 Answers   Accenture, TCS, Wipro,


Why java is call by value?

1 Answers  


What is the difference between a local variable and an instance variable?

1 Answers  


Why do we use regex?

1 Answers  


What are selection structures?

1 Answers  


What is stream api in java8?

1 Answers  


Does a class inherit the constructors of its superclass in java programming?

1 Answers  


How do you use, call, and access a static method in Java?

2 Answers  


What about abstract classes in java?

1 Answers  


Categories