package yinggu;
public class Sample {
public static void main(String[] args) {
byte b = 127;
short s = 32767;
int i = 32768;
long l = 12;
float f = 1.12f;
double d = 1.13;
boolean bln = true;
char c= 'a';
System.out.println("Byte类型的位数:"+Byte.SIZE);
System.out.println("Byte类型的取值范围:"+Byte.MIN_VALUE+"~"+Byte.MAX_VALUE);
System.out.println("Float类型的取值范围:"+Float.SIZE);
System.out.println("Float类型的取值范围:"+Float.MIN_VALUE+"~"+Float.MAX_VALUE);
System.out.println("boolean类型的取值:"+Boolean.TRUE+"/"+Boolean.TRUE);
System.out.println("char类型的位数:"+Character.SIZE);
System.out.println("char类型的取值范围:"+Character.MIN_VALUE+"~"+Character.MAX_VALUE);
}
}
运行结果如下