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 meant by object oriented programming – oop?
In which order the iterator iterates over collection?
What is the difference between @before and @beforeclass annotation?
What code optimizations techniques you follow in general practice?
2 Answers Accenture, TCS, Wipro,
Why java is call by value?
What is the difference between a local variable and an instance variable?
Why do we use regex?
What are selection structures?
What is stream api in java8?
Does a class inherit the constructors of its superclass in java programming?
How do you use, call, and access a static method in Java?
What about abstract classes in java?