How to create a variable that only allows 3 different values ? For example, the variable color
can only take either one of the 3 values {RED, BLACK, ORANGE}
and nothing else.
Obviously, I know that I can define String color
, but is there a better way to do this ?