title: Anonymous inner class must extend some superclass?
body: <p>I am learning java swing and came across the concept of anonymous inner class. After studying a bit at this <a href="http://c2.com/cgi/wiki?AnonymousInnerClass" rel="nofollow">link</a>, I feel that an anonymous inner class must always extend some other class since the method in which it gets passed as a parameter is predefined. At most, if a method accepts Object instances as parameter, only then we can create an anonymous independent inner class. I just seek your opinion whether I am right. It would be helpful if you could provide some example.
  Thanks in advance. </p>