The parameters of a method in Java are always passed in a value -based manner.
The following methods are intended for object exchange, but are not actually implemented.
Public void Swap (Simpleclass A,simpleclass b) { Simpleclass temp=A; A=b; b=A; }
Because the parameters of the incoming swap are actually a copy of object A and B (assumed to be AA,BB).
Although AA and BB are exchanged in the method, they no longer exist after the method ends.
A and B still refer to the object before calling swap.
------------------------- Split Line ------------------------------------
Actually with the C-pass pointer is a truth,
Suppose that the address of a pointer itself is 0XFFFFFF1A, and the point is (0x000001),
The pass-through function is the value of the pointer, which is 0x000001.
Java: Whether the parameter of a method is a value or a reference