Why byte b = (byte) 0xFF is equals to integer -1?

Viewed 46982

Why byte b = (byte) 0xFF is equal to integer -1?

Ex:

int value = byte b = (byte) 0xFF;
System.out.println(value);

it will print -1?

7 Answers
Related