class Person{ public int Width { set { this.Width = value; } get { return 0; } }}Person p = new Person();p.Width = 30;未處理的“System.StackOverflowException”類型的異常出現在 Property.exe 中。請問大家,當p.Width=30;時為什么會報錯呢?聽別人說,屬性是不保存數據的,字段才保存數據,是這樣嗎?
添加回答
舉報
0/150
提交
取消