int占4字节,4*8=32位,10进制取值范围为 (-2^31-1)~(2^31-1):-2147483648~2147483647
package test; public class test11 { public static void main(String[] args) {
int a = 2147483647;
int a1 = 2147483648;//编译报错
int b = -2147483648;
int b1 = -2147483649;//编译报错
}
}
int占4字节,4*8=32位,10进制取值范围为 (-2^31-1)~(2^31-1):-2147483648~2147483647
package test; public class test11 { public static void main(String[] args) {
int a = 2147483647;
int a1 = 2147483648;//编译报错
int b = -2147483648;
int b1 = -2147483649;//编译报错
}
}