This doesn't makes any sense still i am curious to know if it is possible to stop execution of finally block in java? If yes, how? Say for example the below code:
public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Yes, I executed successfully." );
}
}
}
I want the output on the console will not as Yes, I executed successfully.
Well that seems to be possible I concluded. All answers have something different to accept that it is possible. So, I am not accepting any answer specifically. Refer them to reach to conclusion as according to your satisfaction. Thanks to all who posted answers.