top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

0 votes
498 views
Is it necessary that each try block must be followed by a catch block in java?
posted Feb 9, 2018 by Frank Lee

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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 Feb 10, 2018 by Gn Guruswamy
...