The Docs lines "Docs says : A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Enum Types), the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer"
is for
switch(expressions used here)
and not with case
statement.
You can use primitive type int
with case
and then Integer.valueOf(your_int_value);
where ever you want it as a Integer