
In prior releases, the standard way to represent an enumerated type was the int Enum pattern:
// int Enum Pattern - has severe problems!
public static final int SEASON_WINTER = 0;
public static final int SEASON_SPRING = 1;
public static final int SEASON_SUMMER = 2;
public static final int SEASON_FALL = 3;
But these are not type safe, and clearly naming them is bit of a problem. So in Java 5, they introduced Enums.
Eg.
enum Season { WINTER, SPRING, SUMMER, FALL } public enum Rank { DEUCE, THREE, FOUR, FIVE, SIX,
SEVEN, EIGHT, NINE,...