Hi
Why won't
java allow to return a value in finally block ??
public static void main(
String[] args)
{
System.out.println("Method output is:"+ getValue());
}
public static boolean getValue()
{
try
{
return true;
}
catch(Exception e)
{
return false;
}
finally
{
return true;
Here compilation error occurs }
}
Is it that returning in finally overwrites the value returned in the catch block if the exception occurs ??