class Demo
{
static int num;
public static void setNum(int num)
{
num = num;
}
public static void show()
{
System.out.println(num);
}
}
class Test
{
public static void main(String[] args)
{
System.out.println(Demo.num);
Demo.setNum(3);
Demo.show();
}
}
请问this是解决局部变量隐藏成员变量,现在在public static void setNum方法中是不能使用this的,那么现在应该如何解决?
|