<分区>
我在工作时遇到了这种特殊行为,但我不确定这里的问题是什么。按照我的说法,Static keyWord 有一些特性
1。属于类而不是对象。
2。静态方法可以访问类的静态实例变量。
但是有人可以解释一下特定的行为吗:
public static final int x=12;
public static void go(final int x){
System.out.println(this.x);
}
在编写这一特定行时,我在 Eclipse 中打印语句 "this.x" 时遇到complile 时间错误,因为“无法使用this in static conetext”。
有人可以解释一下我的理解中缺少什么吗??