this should not be referenced in a static method because static methods are associated with the class : this « Modifiers « SCJP






public class MainClass {
  public static int i = 0;

  public static void main(String[] argv) {
    System.out.println(this.i);
  }
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	Cannot use this in a static context

	at MainClass.main(MainClass.java:5)








3.9.this
3.9.1.this. always refers to the currently executing object.
3.9.2.this should not be referenced in a static method because static methods are associated with the class
3.9.3.Using this to call a constructor
3.9.4.this() and super()