What do you mean by "result"?
Remember that variables are passed to methods by value. The method inc can only change its copy of the variable, not the source of the value.