As for the parameter passing of the method, the parameter passing of the method in Java is a value pass, according to the type of delivery and the processing of parameters in the method can be divided into 2 categories:
1. The pass parameter is the base data type, because it is a value pass, so the method runs at the end of the value of the passed parameter has no effect.
2. Pass a parameter as an object variable, at which point you can assume that the value passed is a reference to the object, that is, the value of the passed parameter (that is, the object reference) is not affected after the method has finished running.
2.1 If the instance domain of the object instance referred to by the parameter is modified inside the method, the modification is valid
2.2 If the formal parameter itself is modified within the method, that is, the object pointed to by the parameters is changed, all operations on the parameter within the method have no effect on the actual parameter.
Java parameter passing