title: is the keyword 'this' is a static thing..?
body: <p>well i was writing a program and stuck at a line that why it's working...here is my code.</p>
  
  <pre><code>public class X
  {
      int a;
      public void func(int a)
      {
          System.out.println(a);
          System.out.println(this.a);
          System.out.print(X.this.a);
      }
      public static void main(String ... args)
      {
          X var=new X();
          var.func(5);
      }
  }
  </code></pre>
  
  <p>it's giving me output as-</p>
  
  <p>5
  0
  0</p>
  
  <p>but why X.this working because we all know "this" is non-static from this example-</p>
  
  <pre><code>public class Me
  {
      static Me m,m1;
      int x;
      public  Me Me1()
      {
          System.out.println("yes");
          return Me.this;
      }
  
      public static void main(String ... args)
      {
          m=new Me();
          m1=new Me().Me1();
          System.out.println(m.x+" "+m1.x);
      }
  
  }
  </code></pre>
  
  <p>now this program is running but if i put</p>
  
  <pre><code>public static Me Me1()
  {
      System.out.println("yes");
      return Me.this;
  }
  </code></pre>
  
  <p>then it gives the error "non-static variable this can not be referenced from a static context"</p>
  
  <p>i know it is because the static function comes in the existence before object creation so that we can not use "this" in any non-static function.</p>
  
  <p>my question is why "this" can be referenced like Me.this from a non-static function without any error..?</p>