First, value passing and reference passing in Java
Value passing: When a method is called, the actual parameter passes its value to the formal parameter, and the change of the parameter and the change of the actual parameter during the execution of the method will not be affected.
This delivery is for the underlying data type.
Reference delivery: Also known as a pass-through address. When a method is called, the reference to the actual parameter (the address, not the value of the parameter) is passed to the corresponding formal parameter in the method, and in the execution of the method, the operation of the formal parameter is actually the operation of the actual parameter, and the change of the form parameter during the execution of the method will affect the value of the actual parameter.
The concept of value passing and reference passing, abstraction, and interface in Java