
package com.bjpowernode.javase1.integer1;
public class IntegerTest04 {
public static void main(String[] args) {
/*通过常量获取最大值和最小值*/
System.out.println("int的最大值:" + Integer.MAX_VALUE);
System.out.println("int的最小值:" + Integer.MIN_VALUE);
System.out.println("byte的最大值:" + Byte.MAX_VALUE);
System.out.println("byte的最小值:" + Byte.MIN_VALUE);
/* 包装类.MAX_VALUE/MIN_VALUE 是 Class Integer中的一个使用*/
}
}
输出:
int的最大值:2147483647
int的最小值:-2147483648
byte的最大值:127
byte的最小值:-128
进程已结束,退出代码 0
原文:https://www.cnblogs.com/function123/p/13876641.html