I found this piece of code in a java certification website
public class Test1{
public static void main(String args[]){
System.out.println(method());
}
public static int method(){
try{
return 1;
}
catch(Exception e){
return 2;
}
finally{
return 3;
}
}
}
So the output of this piece of code is shown as 3. How is this possible..since it is returning 1 in the try block itself? The code will never reach finally right??