Static Function Test

public class StaticTestCls
{
public int x = 0;
public static int y = 0;
private void SetValue_Object()
{
x = 1;
y = 1;
}
public static void SetValue_Static()
{
x = 2; //Error 要求对象引用
y = 2;
}
}

posted @ 2013-12-03 14:28  DaCHun  阅读(124)  评论(0)    收藏  举报