+ 1

Could someone tell me why the output of this code is 87?

byte x =(byte) 1111L;

13th Aug 2019, 4:17 PM
Miosotis
2 odpowiedzi
+ 2
1111 dec is 100 01010111 bin first 8 bits (from right) is for signed byte type 01010111 bin is 87 dec you lost one byte of information here
13th Aug 2019, 4:44 PM
zemiak
0
Thank you zemiak
13th Aug 2019, 7:51 PM
Miosotis