Are there any real life uses for the Java byte primitive type?

后端 未结 10 1745
清歌不尽
清歌不尽 2020-12-23 13:16

For some inexplicable reason the byte primitive type is signed in Java. This mean that valid values are -128..127 instead of the usual 0..255 range representin

10条回答
  •  爱一瞬间的悲伤
    2020-12-23 14:00

    I think it is signed in order to be consistent with short and int.

    As to whether it is used much, it makes the notion of "byte arrays" a construct rather than a primitive.

    That's really all I have. :)

提交回复
热议问题