Why different class files are created for each enum type if they have constant-specific method?
i have one enum as enum OperationsType { ADD("+"), SUB("-"), DIV("/"), MUL("*"); private String opcodes; private OperationsType(String opcodes) { this.opcodes = opcodes; } public String toString() { return this.opcodes; } } Here all enum type doesn't have any constant Specific method so javac is creating only one class file for enum as OperationsType.class but if i add constant Specific method in same code for all enum type then javac is creating 5 class files. Operations.class Operations$1.class Operations$2.class Operations$3.class Operations$4.class for below code enum Operations { ADD("+")