I really don't understand use of finally block... in try-catch block, Whether we use finally or not we can get same run of our code. for example what is difference between these code:
try
{
System.out.println(1/0);
}
catch(ArithmeticException e)
{
System.out.println("Error");
}
finally
{
System.out.println("After try-catch");
}
and this:
try
{
System.out.println(1/0);
}
catch(ArithmeticException e)
{
System.out.println("Error");
}
System.out.println("After try-catch");
what is logically difference in output or hierarchy of running codes???