Short toHexString

后端 未结 5 1654
别那么骄傲
别那么骄傲 2021-02-19 14:54

There are methods Integer.toHexString() and Long.toHexString(). For some reason they didn\'t implement Short.toHexString().

What

5条回答
  •  独厮守ぢ
    2021-02-19 15:16

    Yes, you can simply take the two least-significant bytes.

    This is a basic feature of the Two's Complement representation.

提交回复
热议问题