using System;
using System.Collections.Generic;
using System.Text;
namespace 值和引用
{
class Program
{
public void swap(ref int x,ref int y)
{
int wy = x;
x = y;
y = wy;
}
static void Main(string[] args)
{
int a = 100, b = 200;
Console.WriteLine("之前:a:{0},b:{1}", a, b);
Program loves=new Program ();
loves.swap(ref a,ref b);
Console.WriteLine("之后:a:{0},b:{1}", a, b);
Console.Read();
}
}
}