大家看看这个程序,我觉得get与set真是没用呢,大家在实际中用到了么?
using System;namespace Test3
{
class Address
{
protected string City;
protected string zipCode;
public string ZipCode
{
get
{
return zipCode;
}
set
{
zipCode=value;
}
}

} class PropertyApp
{
public static void Main()
{ Address addr=new Address();
addr.ZipCode="38343";
string zip=addr.ZipCode;
Console.WriteLine("{3}",zip);
Console.Read();
}
}

}