我觉得答案很简单,但我还是没明白它。
byte a=5;
int b=10;
int c=a>>2+b>>2;
System.out.print(c);
由于 a>>2
的结果为 1
,b>>2
的结果为 2
,因此我期望输出结果为 3
,但实际输出为 0
。这是什么原因?