public enum sEnum { zero = 0, one = 1 } public int x; public static void a(sEnum s) { x = 3; if (s == sEnum.one) ... }
Why can values
Enums are just named values so you can use them in a static context just like any other constant.
Section 3.4.3 of the language specification states:
The members of an enumeration are the constants declared in the enumeration