title: Why can't I call a method outside of an anonymous class of the same name
body: <p>The code at the end produces a compile error:</p>
  
  <pre><code>NotApplicable.java:7: run() in  cannot be applied to (int)
                  run(42);
                  ^
  1 error
  </code></pre>
  
  <p>The question is why?  Why does javac think I am calling run(), and does not find run(int bar)?  It correctly called foo(int bar).  Why do I have to use NotApplicable.this.run(42);?  Is it a bug?</p>
  
  <pre><code>public class NotApplicable {
  
      public NotApplicable() {
          new Runnable() {
              public void run() {
                  foo(42);
                  run(42);
                  // uncomment below to fix
                  //NotApplicable.this.run(42);
              }
          };
      }
  
      private void run(int bar) {
      }
  
      public void foo(int bar) {
      }
  }
  </code></pre>