An anonymous class is essentially a local class without a name. Instead of defining a local class and then instantiating it, you can often use an anonymous class to combine these two steps. Anonymous classes are very commonly used as adapter classes. As anonymous classes (and their corresponding anonymous objects) are created through another extension to the syntax of the new operator. Thus, an anonymous class is defined by a
Java expression, not a Java statement. This means that an anonymous class definition can be included within a larger Java expression such as an assignment or method call(inside the method).
Anil
SCJP 1.5, SCEA, ICED (287,484,486)