Java implicit conversion of int to byte

后端 未结 5 1874
难免孤独
难免孤独 2021-01-17 20:45

I am about to start working on something the requires reading bytes and creating strings. The bytes being read represent UTF-16 strings. So just to test things out I wante

5条回答
  •  萌比男神i
    2021-01-17 21:31

    Because int are signed and 0xffffffff represent -1, and 0xff represent an integer of value 255, which not lie into -128 (0x80) +127 (0x7f) range of a byte.

提交回复
热议问题