Question: [This answer](https://stackoverflow.com/a/1654928/160206) to another questions suggests, as a workaround for finding anonymous classes via reflection, to simply try all names, starting with `...$1` and counting up until no more can be found. Is this guaranteed to find all inner classes, or could there be cases where they start at 0 or some numbers are left out (for whatever reason)?

Answer: 
According to [this answer](https://stackoverflow.com/questions/1075207/what-are-the-1-in-class-file):

> 
> Note that the exact name of the files holding anonymous inner classes
>  is not standardized and might vary. But in practice I've yet to see
>  any other scheme than the one described here.
> 
> 
> 

So I guess there is no such guarantee.
In this link to a java.sun.com [tutorial](http://java.sun.com/developer/Books/certification/certbook.pdf), it explains anonymous classes from page 243 with example outputs which follow the naming convention described.e.g. \*$1.class, \*$2.class etc. On the top of page 246 it says:

> 
> The names of the anonymous classes at runtime are also shown in the program output. They are also the names used to designate their respective class files. Anonymous classes are not so anonymous after all.
> 
> 
> 

Considering that this tutorial is on the Oracle website, It's almost certain that this is a convention that will not vary. Hope this helps :)