Parameter passing mechanism

Deliver basic data type parameters: All parameters java, methods are "value transfer", or "copy of the value is passed," we get is, "a copy of the original argument, not the originals." Therefore, the value of the transfer will not affect the original.

Passing a reference type parameter: passing a copy of the value, but the reference type refers to the "address object", so that a replica and the original parameters point to the same address, change the address of the object pointing copy of the value, means pointing to the value of the object has changed.

 Memory analysis:

 

Guess you like

Origin www.cnblogs.com/laurarararararara/p/11332585.html