using System; namespace Example8 { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { int first = 34, second = 712; Console.WriteLine("Before swap first is {0} and second is {1}", first, second); Swap(ref first, ref second); Console.WriteLine("After swap first is {0} and second is {1}", first, second); } static void Swap(ref int one, ref int two) { int temp = one; one = two; two = temp; } } }