I have a class- public class Check {
public static void main(String[] args) {
System.out.println(new Check().isRight());
}
public boolean isRight(){
try{
return true;
}finally{
return false;
}
}
The method isRight has return true and false in finally clause , and finally it returns me false as finally clause will surely be called, so whats actually happening the data inside try. I need to know the logical reason behind the output , I read but couldn;t understand properly.