Questions tagged «bitwise-and»

4
value&0xff在Java中有什么作用?
我有以下Java代码: byte value = 0xfe; // corresponds to -2 (signed) and 254 (unsigned) int result = value & 0xff; 打印时结果为254,但我不知道此代码如何工作。如果&运算符只是按位运算符,那么为什么它不产生字节而是取整数?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.