【发布时间】:2014-08-16 13:47:41
【问题描述】:
我正在尝试找出 >>= 和 >>>= 之间的区别。我明白他们在做什么,但我不明白他们的区别。 下面的输出为 38 152 38 152。 按位赋值 >>>= 似乎与 >>= 完全相同。
public static void main(String[] args)
{
int c = 153;
System.out.print((c >>= 2));
System.out.print((c <<= 2));
System.out.print((c >>>= 2));
System.out.print((c <<= 2));
}
【问题讨论】:
-
I understand what they do他们是做什么的?你的成绩 100% 取决于你的答案。 -
当您在负数上尝试这些运算符时,您会发现
>>=和>>>=(以及>>和>>>)之间的区别。 -
解释,包括
>>和>>>的区别,这里:Bitwise and Bit Shift Operators
标签: java