Enum
The enum keyword is used to declare an enumeration, a distinct type that consists of a set of named constants called the enumerator list.
public enum Weekdays {monday, tuesday, wednesday, thursday, friday};
Enumerations are useful when designing state-based programs because we can define meaningful states labels and we can use those names in our program to in our control statements to test and query the the active state.
Last updated