整数类型
byte int short long
浮点数类型
float double
字符
char
字符串
String
Boolean 类型
只有true 或 false
变量类型优先级:byte,short,char—> int —> long—> float —> double
1. 不能对boolean类型进行类型转换。
2. 不能把对象类型转换成不相关类的对象。
3. 在把容量大的类型转换为容量小的类型时必须使用强制类型转换。
4. 转换过程中可能导致溢出或损失精度
5. 浮点数到整数的转换是通过舍弃小数得到,而不是四舍五入
-------------------------------------------------------------------------------------------------------------------
位运算符
A=0011 1101
B=1010 1100
-------------------------------------------------------------------------------------------------------------------
A&B =0010 1100 //都为1则1
A|B =1011 1101 //有一个1则等于1
A^B =1001 0001 //都为0则0
~B =0101 0011 //每一位都取反