Java only supports pass-by-value.
Note that variables of non-primitive types are references in Java. When you pass such a value to a method, you're passing a
reference by value - the reference is copied, but not the object that the reference refers to. Passing a reference by value is not the same as passing by reference.
Have a look at the JavaRanch Campfile story
Pass-by-Value Please.
Ralph Cook wrote:... but since the value of an object is a reference to that object, ...
That's not accurate. You mean: The value of a (non-primitive) variable is a reference to an object.