Let's compare anonymous classes, one declared in a static method, another in a non-static method.
javap -private Test$1
javap -private Test$2
Notice how the second anonymous class has a field that refers to a
Test object. The compiler added that field so that the anonymous class can access instance methods and instance fields of the Test object.
[ March 18, 2003: Message edited by: Marlene Miller ]
[ March 18, 2003: Message edited by: Marlene Miller ]