In Java, -1001 not considered a valid integer literal. Why?
-1001
There is no such thing as a negative decimal literal in Java; see JLSยง3.10.1 .
-1001 is a constant expression evaluating compilation time, consisting of the unary negation of the letter 1001.
(The same goes for C and C ++).
The number -1001 is a valid integer literal in java 7 and above.