Console.WriteLine("After: {0}, {1} ", s1, s2);
Console.ReadLine();
}
Here, the caller has assigned an initial value to local string data (s and s2). Once the call to
SwapStrings() returns, s1 now contains the value "Flop", while s2 reports the value "Flip" (see
Figure 4-2).
Figure 4-2.
Reference parameters can be changed by the called method.
Do'stlaringiz bilan baham: