Does Java pass method arguments by value or by reference?
Java passes all arguments by value, not by reference. However this is one of the few places where the distinction between an object and a reference to an object becomes important. Object and array variables in Java are really references to the object or array. This can make it look like an object is passed by reference if you only modify the fields of the object or array, but do not change the reference itself.