Why use anonymous classes?

Objects instantiated from anonymous classes share many of the characteristics of objects instantiated from member classes.

In some cases, an anonymous class can be defined closer to its point of use than would be possible with a member class or a local class.

Once you become accustomed to the cryptic syntax used with anonymous classes, they can often lead to improved code readability.

File: ak.htm [Next] [Prev]