According to this answer , which refers to JLS, anonymous classes are never static , but when created in a "static context" they do not have a "closing instance".
Nonetheless,
If you delete private , they seem to compile in much the same way, except for the EnclosingMethod entry.
Test$1 does not have a field final Test this$0; which would be if it were defined in a non-stationary context.
source share