1.先介绍其他几个
(1)boolean类型取值true,false;
(2)整数常量三种进制:eg 142(十进制) 0142(八进制) 0x142(十六进制)
(3)基本数据类型转换(低----高):
类型 byte short int long float double (这几个都是有符号的)
占内存 1 2 4 8 4 8
注意:将一个整数赋给一个byte,short,int,long时,不可以超出这些变量的取值范围,否则必须进行类型转换
eg: byte a=(byte)128;
byte b=(byte)(-129);
结果a=-128;b=127
2关于char类型(Unicode字符集)
(1).字符常量用单引号括起来,转义字符前加反斜杠/
(2).字符变量占2B,范围0-65535;观察字符在字符集中的位置,必须使用int类型显示转换而不可以使用short类型(因为short类型的范围是-32768-32767)
(3).char类型与整型数据运算时,其精度为int型
3.基本数据的类包装
类型: byte short int long float double char
类包装: Byte Short Integer Long Float Double Character
类方法:byteValue(), intValue(), charValue()等获得值
特别是Character类的方法比较多,例如: isDigit(); isLetter(); isLowCase() 等