public class FinallyTest {
static int i=0;
public static void main(String a[]){
while(true){
try{
i=i+1;
return;
}finally{
i=i+1;
break;
}
}
System.out.println(i);
}
}
In the above code output is '2'. What I was expecting was that nothing should be printed. What exactly does 'break' do here? Please explain. Thanks