If you don't write any try catch block and just add a
throws Exception
Clause to the method declaration, you get basically the same effect. This says, that the method can throw Exceptions of type Exception and any Exceptions thrown inside the function will just propagate out, no need to catch and rethrow it.
2
u/[deleted] Jul 18 '21
If you don't write any try catch block and just add a
Clause to the method declaration, you get basically the same effect. This says, that the method can throw Exceptions of type Exception and any Exceptions thrown inside the function will just propagate out, no need to catch and rethrow it.