IS IT NECESSARY THAT EACH TRY BLOCK MUST BE FOLLOWED BY A CATCH BLOCK?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 642  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

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

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!