For various business reasons I want to hold some static IDs in one of my classes. They were originally int
but I wanted to change them to Integer
s
because I was looking at this...
The accepted answer says that:
switch can only work with primitives, enum values and (since Java 7) strings
However,
14.11 The switch Statement
outlines the JavaSE7 documentation for switch that shows:
The type of the Expression must be char, byte, short, int, Character, Byte, Short, Integer, String, or an enum type (§8.9), or a compile-time error occurs.
I just wanted to clarify for future surfers.