Values and reference parameter values: only one copy of the value is transmitted, so it is not worth the original variable. Quote: Passing a copy of a reference, (another reference to the same data), therefore to change the original data (resolution of the string)
Ref, OUT method parameters REF: Parameters that are being passed points to the same memory address that is being called the variables being called code (initialize the parameters passing before calling) OUT: Same as above, can initialize the parameters before calling, but You must modify the OUT parameter summary within the call: you can't use it before assigning the value of the OUT parameter, and must be assigned to it before returning from the method. public class Class1 {public Class1 () {} protected Class1 (int i) {} public int ID;} public class myclass {/ * public Class1 chaObject (out Class1 ref1) {ref1.ID = ref1.ID * 2; return ref1 Public class1 chaobject (out class1 ref1) {ref1.id = 4; return ref1;} public class1 chaobject (out class1 ref1) {int x = ref1.id; ref1 = new class1 (); ref1.id = x * 2; RETURN REF1;} * / public class1 chaobject (out class1 ref1) {ref1 = new class1 (); ref1.id = 99; return ref1;}} public class test {static void main (String [] args) {Myclass MC = new myclass (); class1 ref1 = new class1 (); ref1.id = 3; class1 ref2 = mc.chaobject (out ref1);}} The place that is commented off is unable to pass. Summary: If the reference is passed through the value, then it is a copy of the reference; if it is passed by reference, we are actually the original reference.