I have an enum in Java:
public enum Months
{
JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
}
I want to access enum values by index, e.g.
Months(1) = JAN;
Months(2) = FEB;
...
How shall I do that?
Try this
Months.values()[index]