Justin van Wilgen wrote:I know in java things are normally passed by reference, ...
That's wrong - in Java, method arguments are
always passed by
value, and never passed by reference.
Many people are confused by this, because variables of non-primitive types are references in Java. When you pass such a variable to a method, it is still passed by value - but you are passing a reference by value; in other words, a copy of the
reference is made. But passing a reference by value is not the same as passing by reference!