the transfer of the parameters in Java is inherently only a value pass, no matter what you preach, the pass is just a copy, and this copy is stored as a local variable of the method in the stack.
1. Assuming that the parameter type is the basic data type, changing the value does not affect the variable that is passed in as a parameter, because you are changing the local variable of the method, which is a copy.
2, it is assumed that a reference to an object, but also the same, but also a copy, but this copy and as a reference to pass in the references to the same object in memory, so you can also manipulate the object through this copy. But suppose you change the reference itself, for example, to point to another object in memory, and the reference that was passed in as a parameter is not affected.
The most confusing thing here is that when you pass a reference to an object, the value of that parameter is changed in the sub-method, causing it to change and therefore mistakenly assumed to be a reference pass. In the definition of C + +. so-called Reference Delivery refers to passing the address of the actual parameter to the function when the function is called. Then the changes to the parameters in the function. will affect the actual number of references. However, in Java is not satisfied, first of all, Java is passing a copy of the object instead of the object itself, and secondly, when you specify the memory address in the function, the actual number of the parameters is not affected. This is completely different from C + +, so it's not a reference pass, it's just an effect like a reference pass.
Java values Pass or reference pass-through doubts