">>>"运算符
在Java语言中,">>>"运算符为有符号右移操作,就是符号位也会一起做右移
int h = -100;
int h2 = h >>> 16
h2结果为65535
">>"运算符
在Java语言中,">>"运算符为无符号右移操作,符号位保持不变
int h = -1;
int h2 = h >> 10;
h2结果还是 -1
>>"运算符 和 ">>" 运算符" /> >>"运算符 和 ">>" 运算符 - 码农公寓" />
2022-11-28 07:57:07
在Java语言中,">>>"运算符为有符号右移操作,就是符号位也会一起做右移
int h = -100;
int h2 = h >>> 16
h2结果为65535
在Java语言中,">>"运算符为无符号右移操作,符号位保持不变
int h = -1;
int h2 = h >> 10;
h2结果还是 -1