I tried to find the difference between an enum static declaration?
public class Example { public static enum Days { MONDAY(1); private int day; private Days(int day) { this.day = day; } public int getDayNum() { return day; } } }
And below
public class Example { public enum Days { MONDAY(1); private int day; private Days(int day) { this.day = day; } public int getDayNum() { return day; } } }
I can access both of the above in the same way
Example.Days.MONDAY.getDayNum();
This is because the enumeration is static, final . So what is the difference? When to use any of the above?
noMAD source share