title: Why does Java create anonymous class internally as static?
body: <pre><code>abstract class Person {  
  abstract void eat();  
  }  
  
  class TestAnonymousInner {  
    public static void main(String args[]){  
    Person p=new Person() {  
      void eat(){System.out.println("nice fruits");}  
      };  
    p.eat();  
    }  
  }
  </code></pre>
  
  <p>Internal class generated by the compiler</p>
  
  <pre><code>static class TestAnonymousInner$1 extends Person
  {
      TestAnonymousInner$1(){}
      void eat()
      {
          System.out.println("nice fruits");
      }
  }
  </code></pre>
  
  <p>For which reason does the compiler create the anonymous class as static? What would happen if it's non-static?</p>