[英]Java when shifting bits left, overflows dont disappear but appear back on other side
int i = 0x000000FF;
i = i << 24;
message = String.format("0x%08X", i);
// prints the message 0xFF000000
int i = 0x000000FF;
i = i << 32;
message = String.format("0x%08X", i);
// prints the message 0x000000FF
我期待第二个打印0x00000000
到底是怎么回事?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.