From the Java Language Spcifications:
The largest decimal literal of type int is 2147483648 (231). All decimal literals from 0 to 2147483647 may appear anywhere an int literal may appear, but the literal 2147483648 may appear only as the operand of the unary negation operator -.
The expression "(long)9223372036854775807" says to create an
int with the value 9223372036854775807 and then cast it to type
long. But 9223372036854775807 is greater than 2147483647, so it is not a legal
int literal.
This will work because there is no attempt to create an
int first:
float f = 9223372036854775807L;
[ March 21, 2005: Message edited by: Mike Gershman ]