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
 771  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

      Modified On Mar-28-2018 12:36:47 AM

Answer

NEWSLETTER

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