Home > DeveloperSection > Interviews > Is it necessary that each try block must be followed by a catch block?

Posted on    April-23-2015 12:24 AM

 Java Exception Handling  Java 
Ratings:
 1 Answer(s)
  426  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    April-23-2015 12:24 AM

It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block OR a finally block. And whatever exceptions are likely to be thrown should be declared in the throws clause of the method

Don't want to miss updates? Please click the below button!

Follow MindStick