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

In Java, what are public static void main string args?

2 Answers  


What is a dot notation?

0 Answers  


Can we declare a class as abstract without having any abstract method?

0 Answers  


What is the difference between numeric and integer?

0 Answers  


Can you explain the Java thread lifecycle?

1 Answers  


In the HashMap, we know the values but we dont know the key, then how can we get the key from HashMap ?????

4 Answers   Kanbay,


1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?

2 Answers   TCS,


If your team member writes code with lots of static variables and static methods, will it cause any side effects?

3 Answers   KPIT,


What is qms certification?

0 Answers  


How to make a class or a bean serializable?

0 Answers  


What do you understand by java?

0 Answers  


Why charat is used in java?

0 Answers  


Categories