class Program { static void Main(string[] args) { MyClass MyObject = new MyClass(); Console.Write(MyObject.Integer); MyObject.Integer++; Console.Write(MyObject.Integer); } } class MyClass { int integer; public int Integer { get { return integer; } set { integer = valeue; } //integer = 55; } }
输出的结果是:01
如果使用备注的。输出结果是055