title: Can I access new methods in anonymous inner class with some syntax?
body: <p>Is there any Java syntax to access new methods defined within anonymous inner classes from outer class? I know there can be various workarounds, but I wonder if a special syntax exist?</p>
  
  <p>For example</p>
  
  <pre><code>class Outer {
  
      ActionListener listener = new ActionListener() {
  
          @Override
          void actionPerformed(ActionEvent e) { 
               // do something
          }
  
          // method is public so can be accessible
          public void MyGloriousMethod() {
               // viva!
          }
  
      };
  
      public void Caller() {
           listener.MyGloriousMethod(); // does not work!
      }
  
  
  }
  </code></pre>
  
  <p><strong>MY OWN SOLUTION</strong></p>
  
  <p>I just moved all methods and members up to outer class.</p>