本帖最后由 鲜学良 于 2012-12-21 16:33 编辑
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
user u1=new user{UName="kk",Age=12};
Change(u1);
Console.WriteLine(u1.UName);
Console.ReadKey();
}
static void Change(user u)
{
u=new user();
u.UName="change";
}
public class user
{
public string UName{get;set;}
public int Age{get;set;}
}
}
}
//为什么输出结果不是change呢
|