代码:
package java01;
public class E0 {
public static void main(String[] args) {
System.out.println(“byte取值范围:” + Byte.MIN_VALUE + “至” + Byte.MAX_VALUE);
System.out.println(“short取值范围:” + Short.MIN_VALUE + “至” + Short.MAX_VALUE);
System.out.println(“int取值范围:” + Integer.MIN_VALUE + “至” + Integer.MAX_VALUE);
System.out.println(“long取值范围:” + Long.MIN_VALUE + “至” + Long.MAX_VALUE);
System.out.println(“Float取值范围:” + Float.MIN_VALUE + “至” + Float.MAX_VALUE);
System.out.println(“Double取值范围:” + Double.MIN_VALUE + “至” + Double.MAX_VALUE);
}
}
运行结果:
byte取值范围:-128至127
short取值范围:-32768至32767
int取值范围:-2147483648至2147483647
long取值范围:-9223372036854775808至9223372036854775807
Float取值范围:1.4E-45至3.4028235E38
Double取值范围:4.9E-324至1.7976931348623157E308