I would like to use enums to group constant variables in my small program and I would like to set the values so that I can extract the values later and use them as integers.
I am thinking of something like this:
public enum Value {
THREE = 3,
SIX = 6,
NINE = 9
}
So later I can retrive the value for something like this:
int[] myIntArray = new int[Value.THREE];
I previously used C++ this way but this does not work for me in Java. Is there a way of explicitly setting a Java enumerated value and can someone explain how I would set and then extract the value from my enum?