using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication3
{
class MainClass
{
public static void Swap(ref int a, ref int b)
{
int temp = a;
a = b;
b = temp;
}
public static void Swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}
public static void Main(string[] args)
{
Console.WriteLine("Ref Test");
int x = 1;
int y = 2;
Swap(x, y);
Console.WriteLine("After Swap, x:{0},y:{1}", x, y);
int u = 1;
int v = 2;
Swap(ref u, ref v);
Console.WriteLine("After Swap, u:{0},v:{1}", u, v);
Console.ReadLine();
}
}
}