Consider the enum:
enum day{ MONDAY, TUESDAY};
What are monday, tuesday. the sun documentation says that they are fields in the special class type enum. But, if that is the case, why can we do:
day d=day.MONDAY
I mean how can we assign a class constant to a class variable.
Like @Jon’s suggestion but more specificly …
EDIT: I have added some of the methods Enum provides for you. I hope that helps…
This may not be how it is implemented but how you could implement it.