Why is this int switch valid:
public class Foo {
private final static int ONE = 1;
private final static int TWO = 2;
public static void main(String
Because a case statement label must have either a compile time constant or an EnumConstantName. JLS 14.11
Compile time constants can only be strings and primitive types, as described by JLS 15.28. Thus you can not use a static final