My guess is that the switch uses the Enum.ordinal() method to get to an int value under the covers. That makes the Enum value an int value and thus valid for the switch-function.
But I might be wrong....
Cor
SCJP 1.5
Dolphins are grey, but they dream in colour.
My guess is that the switch uses the Enum.ordinal() method to get to an int value under the covers.
You may be able to convert an Enum to an int, but an Enum is really an instance of a subclass of Enum. An Enum is not compatible with an int and that's a good thing so that you don't accidentally pass an int constant where it isn't appropriate. With enum values, if you try to pass them as parameters where an int is required, you get a compile-time error.