associated with class should always be declared to be both static and final enum types since java supports enumerated typescalled enums these are types that are only allowed to take on values that come from specified set of names they are declared inside of class as followsmodifier enum name value_name value_name value_name - }where the modifier can be blankpublicprotectedor private the name of this enumnamecan be any legal java identifier each of the value identifiersvaluenameiis the name of possible value that variables of this enum type can take on each of these name values can also be any legal java identifierbut the java convention is that these should usually be capitalized words for examplethe following enumerated type definition might be useful in program that must deal with datespublic enum day montuewedthufrisatsun }once definedwe can use an enum typesuch as thisto define other variablesmuch like class name but since java knows all the value names for an enumerated typeif we use an enum type in string expressionjava will automatically use its name enum types also have few built-in methodsincluding method valueofwhich returns the enum value that is the same as given string we show an example use of an enum type in code fragment code fragment type an example use of an enum