Anonymous class
Hi,
What is an anonymous class?
As far as I know, it does not have any name. But still I think a class with the name "outerclassname$1" or 2 or 3 and so on are created when the class is compiled.
When there is a class created with some or the other name, how can we call it as an anonymous class.
We can even find that name dynamically and use that class using that name?
Thanks in Advance
> As far as I know, it does not have any name.
My friend is anonymous on this forum. That doesn't change the fact that he *has* a name; we just don't use it when referring to him.
Don't get tripped up on this minor detail. An anonymous class is just an inner class that is "derived from a class instance creation expression" (per the JLS). You don't name it in the code, and the class is created for you by the compiler.
~