Why does method return true
if I change the value of r
to false
in finally?
boolean myMethod() {
boolean r = true;
try {
throw new Exception("");
} catch (Exception e) {
return r;
} finally {
//System.out.println("executing finally");// will print if we uncomment this line
r = false;
}
}