位运算符分为:& | ^ ~
(1)按位与运算符(&),其结果如下:
0 & 0 = 0 0 & 1 = 0 1 & 0 = 0 1 & 1 = 1
(1)按位或运算符(|),其结果如下:
0 | 0 = 0 0 | 1 = 1 1 | 0 = 1 1 | 1 = 1
(1)按位异或运算符(^),其结果如下:
0 ^ 0 = 0 0 ^ 1 = 1 1 ^ 0 = 1 1 ^ 1 = 0
(1)按位取反运算符(~),它为单目运算符,为0的变为1,为1的变为0