6 Replies Latest reply: Mar 22, 2007 2:31 AM by 843789 RSS

    Anonynous Inner Classes

    843789
      Hi, i was goin through Anonymous Inner Classes, i have a doubt.
      Please go through the snippet below.

      class Anonymous
      {
           public void pop()
           {
                System.out.println("Original pop");
           }
      }
      class Sub
      {
           Anonymous a = new Anonymous(){
                public void pop()
                {
                     System.out.println("Anonymous pop");
                }
           };
      };
      class AnonymousEg
      {
           public static void main(String[] args)
           {
      }
      }


      How do i access pop() method declared in the class Sub.

      Thanx in advance.