Exception Handling in Java
Exception Handling is a process of handling Runtime Exceptions.
Lets consider the concept of try and catch blocks in order to analyse Exception Handling with the below defined Example.
In the Above Scenario we have basically considered try and catch Block where in if there is any exception occurs then we tend to enter the catch Block.
Get Surajkh’s stories in your inbox
Join Medium for free to get updates from this writer.
Now we can even have a scenario of having Multiple Try and Catch Block as defined in the below Figure.
Now we might come across a scenario, when we are expected to consider the execution of the statements irrespective of whether an exception occurs or not, that is where finally block comes into picture.
As shown in the above Diagram the finally block gets executed irrespective whether an exception(In this case : (ArithmeticException) occurs or not).
Thank You.










