catch and exception handling code example
Example 1: try catch exception
First try block try to handle it
if not then catch block will handle it.
Finally block will executed regardless
of the outcome
Example 2: handling exceptions
I use try & catch & finally block
to handle exception if I will use the method
in different class.
Or If I will use it only once and if it is checked
exception then I use THROWS keyword on method signature