if I have a return value both from try and finally then the value returned from finally is taken.
for ex here is a code snippet
public int returnint () {
try {
return 1;
} finally {
return 2;
}
}
this code will return 2.my question is why
java has allowed this and why does not it generate compile error if we want to return some value from the finally block.