Inner classes, if any present in your class, will be compiled and the class file will be ClassName$InnerClassName
. In case of Anonymous inner classes, it will appear as numbers. Size of the Class (Java Code) doesn't lead to generation of multiple classes.
E.g. given this piece of code:
public class TestInnerOuterClass {
class TestInnerChild{
}
Serializable annoymousTest = new Serializable() {
};
}
Classes which will be generated will be:
TestInnerOuterClass.class
TestInnerOuterClass$TestInnerChild.class
TestInnerOuterCasss$1.class
Update:
Using anonymous class is not considered a bad practice ,it just depends on the usage.
Check this discussion on SO
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…