class Program
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
mc.ID = "001";
mc.NAME = "amders";
Console.WriteLine(mc.ID + " , " + mc.NAME);
Console.ReadKey();
}
}
class MyClass
{
private string id = "";
private string name = "";
public string ID
{
get { return id; }
set { id = value; }
}
public string NAME
{
get { return name; }
set { name = value; }
}
}
c#学习5(属性)
最新推荐文章于 2018-04-24 10:04:21 发布