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

后端 未结 10 1726
清歌不尽
清歌不尽 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:10

    I used it frequently when I was programming software and games for J2ME. On most J2ME-devices, you have limited resources, so storing for example the map of a level in a byte-array is less resource-intensive than storing it in an int-array.

提交回复
热议问题