Why can't your switch statement data type be long Java?
- by Fostah
Here's an excerpt from Sun's Java tutorials:
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer (discussed in Simple Data Objects ).
There must be a good reason why the long primitive data type is not allowed. Anyone know what it is?