This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes anonymous local class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "anonymous local class" Watch "anonymous local class" New topic
Author

anonymous local class

Syamsul Hussin
Ranch Hand

Joined: Feb 09, 2003
Posts: 59
please explain to me about anonymous local class and when should we use them. thanks
Elouise Kivineva
Ranch Hand

Joined: Feb 07, 2002
Posts: 154
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: anonymous local class
 
Similar Threads
Inner class basics. (Marcus Green's mock exam 2)
Anonymous class...please help
Anonymous inner class
anonymous?
anonymous class in methods