title: How to call a method defined while object instantiation?
body: <p>wondering how it is possible to call public m method?</p>
  
  <pre><code>public class Test1 {
  
      public static void main(String[] args) {
          Test1 test = new Test1() {
              public void m() {
                  System.out.println("m");
              }
          };
      }
  }
  </code></pre>