class C
{
public int temp
{
get
{
return temp;
}
set
{
temp = value;
}
}
}
C c = new C();
c.temp = 0; //未处理的“System.StackOverflowException”类型的异常出现在 ConsoleApplication1.exe 中。
这里为什么会抛出一个异常?
...全文
1548打赏收藏
关于get和set访问器的问题。
class C { public int temp { get { return temp; } set { temp = value; } } } C c = new C(); c.temp = 0; //未处理的“System.StackOverflowException”类型的异常出现在 ConsoleApplication1.exe 中。 这里为什么会抛出一个异常?