✔ 最佳答案
Simply put, an anonymous class is a class without a name. In Java, this is possible when a class is defined "inline" - instead of giving it a name and then defining the class in a separate .java file, you just define it right then and there, in an inline block.
The typical use for an anonymous class is when you just need a "quickie" object which will you will never refer to again. An example of this is a Comparator implementation needed to build a sorting object.
An inner class need not be anonymous - you can fully define a class inside another class. But the inner class is only scoped within the outer class, even if it has a name.
For more details, read up on your Java documentation so you can be prepared for your interviewer. To fully understand inner and anonymous classes, you need to use them a few times, and a knowledgable interviewer will easily be able to tell if you really know about them.