基本数据类型对应的类分别是:
Character、Boolean、Byte、Interge、Short、Longr、Float、Double
转换原则
从低精度的向高精度的转换
byte、short、int、long、float、double、char
数字类型转字符类型
byte ------ String str = Byte.toString(byte);
short ------String str = Short.toString(short);
int -------String str = Integer.toString(int);
long ------String str = Long.toString(long);
float ------String str = Float.toString(float);
double ----String str = Double.toString(double);
字符型转数字类型
byte ------ byte toByte = Byte.parseByte(String);
byte ------byte toByte = Byte.valueOf(String).byteValue();
short ------short toShort = Short.valueOf(String).shortValue();
short ------short toShort = Short.valueOf(Sting).shortValue();
int long float double 同理