I am study exceptions in Java and came across this snippet:
public class Test
{
public int b()
{
try
{
System.out.println("try block");
return 0;
}
finally
{
System.out.println("Finally block!");
}
}
public static void main (String[] args)
{
Test t= new Test();
t.b();
}
}
Since the finally block is always executed and in this case you have a return 0 before it, will it still be executed? (What exactly would the output be).