Can Enum Be Lowercase?

Can Enum Be Lowercase?

Java conventions are that enum names are all uppercase, which immediately causes problems if you want to serialize the enum in another form. But when you serialize those enum values, you want to use lowercase values of "left", "top", "right", and "bottom". No problem—you can override Side.

Should enum be uppercase or lowercase?

Because they are constants, the names of an enum type's fields are in uppercase letters. You should use enum types any time you need to represent a fixed set of constants.

Should enum always be uppercase?

Enums are a type and the enum name should start with a capital. Enum members are constants and their text should be all-uppercase. If they are their own class start with upper case, if they are members lower case.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.