. Reimeus .
, , JLS
int - 2147483648 (2 ^ 31)
int j = 2147483648;
Error:(20, 17) java: integer number too large: 2147483648
2 ^ 31 2147483648, 0x80000000, 32- -1.
, 2 ^ 31 int.
int can only represent values from Integer.MIN_VALUE
, which is -2 ^ 31, to Integer.MAX_VALUE
, which is (2 ^ 31) -1. And, fortunately, the compiler does not accept integer literals outside this range.
source
share