![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 class Person 2 { 3 private string name; 4 private string age; 5 private string job; 6 7 public Person(string name,string age,string job) 8 { 9 this.name = name; 10 this.age = age; 11 this.job = job; 12 } 13 14 //因为有get方法,所以必须要有返回类型 15 public string Name 16 { 17 get { return this.name; } 18 set { this.name = value; }//赋值的来源是系统级别的value变量,系统维护的 19 } 20 21 public string Age 22 { 23 get { return this.age; } 24 set { this.age = value; } 25 } 26 27 public string Job 28 { 29 get { return this.job; } 30 set { this.job = value; } 31 } 32 }