It might sound like a dumb question, but all anonymous classes must be defined and instantiated within an existing class; therefore, they must be inner classes at the same time.
Anonymous classes are types of inner classes. See http://docs.oracle.com/javase/tutorial/java/javaOO/innerclasses.html
Quoting from there:
"You can also declare an inner class within the body of a method without naming the class. These classes are known as anonymous classes."