标签:
public class UserData { List<Student> stulist = new List<Student>(); //实例化student类型的集合 public List<Student> Stulist //设置属性读取 { get { return stulist; } set { stulist = value; } } List<Teacher> tealist = new List<Teacher>(); public List<Teacher> Tealist { get { return tealist; } set { tealist = value; } } }
UserData ud = new UserData(); //实例化封装后的类,调用 internal UserData Ud //封装属性,可以不封装,但是推荐封装 { get { return ud; } set { ud = value; } }
标签:
原文地址:http://www.cnblogs.com/ianism/p/4220398.html