public class PubCHClassInfo
{
public int Id;
public string Name = string.Empty;
public string Nick = string.Empty;
}
请问这样写的目的是什么?和
C# code
public class PubCHClassInfo
{
private int _id;
public int Id
{
get { return _id; }
set { _id = value; }
}
private string _name;
public string Name
{
get{return _name;}
set{_name = value;}
}
}