using System;
public class ValueReferenceType
{
public static void Main()
// Value Type (Copies the actual value on the stack)
int a = 10;
int b = a;
Console.WriteLine(string.Format("a = {0}, b = {1}",a,b));
// Reference Type (Copies the Reference/address from heap. not an actual value)
int[] array1 = new int[3] {1,2,3};
int[] array2 = array1; // this actually copies the reference/address from heap into the stack for Array2.
array2[0]=0; //this change the actual value of 0th element present in the address/reference of heap.
Console.WriteLine(string.Format("array1[0]: {0}, array2[0]: {1}",array1[0],array2[0]));
}