Is it necessary that each try block must be followed by a catch block?



Is it necessary that each try block must be followed by a catch block?..

Answer / Abhishek Srivastav

No, it's not mandatory. A try block can be followed by either one or more catch blocks or a finally block (or both). If there are no catch blocks for a particular exception thrown in the try block, it will propagate up to the caller until it is handled.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is parameter example?

1 Answers  


Explain java coding standards for interfaces?

1 Answers  


Why generics are used in java?

1 Answers  


What is the difference between form & report?

1 Answers  


What are the OOAD concepts in java explain with examples?

4 Answers   Aricent, CTS,


What is the definition of tree ?

1 Answers   Amazon,


ublic class Java_Coding_Samples { public static void JavaHungr(NumberFormatException ae){ System.out.println("integer"); } public static void JavaHungry(Exception e){ System.out.println("string"); } public static void JavaHungry(ArithmeticException ae){ System.out.println("object"); } public static void main(String[] args) { JavaHungry(null); }

1 Answers  


What does the “static” keyword mean? Can you override private or static method in java?

1 Answers  


Explain access specifiers?

1 Answers   Thomson Reuters, Virtusa,


What is difference between identifier and variable?

1 Answers  


How does thread synchronization occurs inside a monitor?

1 Answers  


What are the 5 types of research methods?

1 Answers  


Categories