«
^
»
9.7 Is an enum type a class type?
In other languages, a unique int is associated with each enum value.
If a variable that is of enum type is assigned a value, the appropriate integer value is stored in the variable.
However, the literature about Java 5 refers to an enum declaration as being a
special kind of class declaration
.
Probably the case that each enum value has an associated object.
When an enum variable is assigned an enum value, a pointer to the appropriate enum object is assigned to the enum variable.
So,
==
operator gives same result as the
equals
method.