Output is fine (as it should be) . I think you are thinking about the local variable i with instance variable i? In xMethod(int i), you are passing the value of the instance variable i to it but when you do i-- in the method it change the value of the local variable not the value of the instance variable. Because a copy of the value is passed to the method as the argument. Hope this helps.