These days have been tangled up this problem, today read this article a bit of thinking, this and C + + function parameters for reference, pointers or a very big difference.
When an object is passed as a parameter to a method, this method can change the properties of the object and return the changed result, is it a value pass or a reference pass?
A: The value is Passed. The Java programming language has only value-passing Parameters. When an object instance is passed as a parameter to a method, the value of the parameter is a copy of the Object's Reference. Point to the same object, the contents of the object can be changed in the called method, but the Object's reference (not the referenced copy) is never Changed.
Java parameters, Whether primitive or reference, are passed as replicas (another argument is a pass value, but a copy is better understood, and the pass value is usually relative to the address).
If the parameter type is the original type, then a copy of the parameter is passed in, that is, the value of the original parameter, which is the same as the value that was previously Discussed. If you change the value of a copy in a function, the original value is not Changed. If the parameter type is a reference type, then a copy of the reference parameter is passed in, and the copy holds the address of the Parameter. If you do not change the address of the copy in the function, but instead change the value in the address, the changes within the function will affect the parameters passed IN. If you change the address of a copy in a function, such as new, the copy points to a new address, and the passed in parameter points to the original address, so the value of the parameter is not Changed. Reprinted from: http://www.cnblogs.com/clara/archive/2011/09/17/2179493.html
Value passing and reference passing in Java