Module java.base
Package java.lang

Class Enum<E extends Enum<E>>

java.lang.Object
java.lang.Enum<E>
Type Parameters:
E - The type of the enum subclass
All Implemented Interfaces:
Serializable,Comparable<E>,Constable

public abstract classEnum<E extends Enum<E>>extendsObjectimplementsConstable,Comparable<E>,Serializable
This is the common base class of all Java language enumeration classes. More information about enums, including descriptions of the implicitly declared methods synthesized by the compiler, can be found in section8.9 ofThe Java Language Specification. Enumeration classes are all serializable and receive special handling by the serialization mechanism. The serialized representation used for enum constants cannot be customized. Declarations of methods and fields that would otherwise interact with serialization are ignored, includingserialVersionUID; see theJava Object Serialization Specification for details.

Note that when using an enumeration type as the type of a set or as the type of the keys in a map, specialized and efficientset andmap implementations are available.

SeeJava Language Specification:
8.9 Enum Classes
8.9.3 Enum Members
Since:
1.5
External Specifications
See Also: