The docs for the Java Enum class state the following about getDeclaringClass:
Returns the Class object corresponding to this enum constant's enum type. Two enum constants e1 and e2 are of the same enum type if and only if e1.getDeclaringClass() == e2.getDeclaringClass(). (The value returned by this method may differ from the one returned by the Object.getClass() method for enum constants with constant-specific class bodies.)
I don't understand when getClass and getDeclaringClass are different. Can someone provide an example along with an explanation?