1.属性 //属性的2种写法 public class person { private string _name; public string Name { get { return _name; } set { _name=value; } } public int Age { get; set; } } 2.索引器 //外部调用 person p=new person; sting str=p[] public class person { private string _name; p…