Java中Integer的最大值和最小值, 占用字节数
/**
* Java中Integer的最大值和最小值, 占用字节数
*
* Java中的int的取值范围
*
* @author www.only-demo.com
*
*/
class IntMinMaxValueDemo {
public static void main(String args[]) {
System.out.println("int最小值: " + Integer.MIN_VALUE);
System.out.println("int最大值: " + Integer.MAX_VALUE);
System.out.println("int占用字节数: " + Integer.BYTES);
}
}
结果
int最小值: -2147483648
int最大值: 2147483647
int占用字节数: 4
参考:
http://www.only-demo.com/java/20190221/287.html