From
JLS 14.10 The switch Statement
The type of the Expression must be char, byte, short, or int, or a compile-time error occurs. The problem here is that a long primitive like 12L fits perfectly within an int but a long is not allowable in a case expression.
If you try to compile the following code
it gives you the following error:
[ June 12, 2002: Message edited by: Valentin Crettaz ]