Suppose you have a "simple" enum:
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
}
And then you use it somewhere:
Day day = Day.SUNDAY;
...
if(day==Day.SUNDAY) {...}
How does this compare performance wise (memory and time) with using ints?
int day = Day.SUNDAY;
...
public class Day {
public static final int SUNDAY=0;
public static final int MONDAY=1;
}
We have the JIT HotSpot compiler enabled along with other "standard" optimization.