|
|||||||
Passing values among same types : int value1 = 0; int value2 = value1; // assign value2, that will not effect value1. value2 = 123;
|
|||||||
Ref_Type
compare ref1 = new compare(); |
|||||||
using System; // csc value_or_ref_Type.cs class compare { public int x = 0; } class Test { static void Main() { int value1 = 0; int value2 = value1; //rea assign value2, that will not effect value1. value2 = 123; compare ref1 = new compare(); //casting one object to another compare ref2 = ref1; ref2.x = 1234; Console.WriteLine("Values: {0}, {1}", value1, value2);
|
|||||||
|