Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Example and use of Anonymous Inner Class in j2ee projects.  RSS feed

 
vikram Kesav
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I need Real time example and real use of Anonymous Inner Class in java projects.

I know the definition of Anonymous Inner Class and use in AWT but not able to visualize its usage in Java specially in J2EE application.

Thanks in advance.


 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginning Java" question. Moving.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any time you need a one-off implementation of an interface. I use them for list transformers a fair amount.

IMO swing programming ends up with a lot of them because that's just how Swing works. IMO web apps are a completely different ballgame, so they're used less for basic functionality and instead as part of library calls.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!