Java – Enum Example

Example to create Enum in Java

— In Java (from 1.5) an Enum is a special data type that enables for a variable to be a set of predefined constants.
— Keyword ‘enum’ is used to define an Enum.
— Because they are constants, the names of an enum type’s fields are in uppercase letters.