P
Philipp
Hello,
I can't understand how the following code works.
If I have a signed byte = -1 (1111 1111) and I logical-AND with 0xFF
(1111 1111) how come there is any effect?
Thanks Phil
--- SSCCE ---
public class byteTest {
public static void main(String[] args) {
byte a = -1;
System.out.println(a);
System.out.println((a & 0xFF));
// Output:
// -1
// 255
}
}
I can't understand how the following code works.
If I have a signed byte = -1 (1111 1111) and I logical-AND with 0xFF
(1111 1111) how come there is any effect?
Thanks Phil
--- SSCCE ---
public class byteTest {
public static void main(String[] args) {
byte a = -1;
System.out.println(a);
System.out.println((a & 0xFF));
// Output:
// -1
// 255
}
}