• Post Reply Bookmark Topic Watch Topic
  • New Topic

anonymous local class

 
Syamsul Hussin
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explain to me about anonymous local class and when should we use them. thanks
 
Elouise Kivineva
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An anonymous inner class is an inner class without a name. To my knowlege they are usually used as event handlers. If you only need a certain event handler in one place, why bother creating it as a separate class when you can just give all the relevant information right where the object is used?

[ February 25, 2003: Message edited by: Elouise Kivineva ]
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!