举个最常用的例子。以前定义属性是这么干:private int x;public int getAge(){return x;}public void setAge(int age){this.x=age;}现在是public int Age{get;set}这么干。作者:江山链接:https://www.zhihu.com/question/23846890/answer/33792043来源:知乎著作权归作者所有,转载请联系作者获得授权。