Short toHexString

后端 未结 5 1667
别那么骄傲
别那么骄傲 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:30

    This should also work for a short

    UnicodeFormatter.charToHex((char)c);
    

    You can download UniocdeFormatter.java here: http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/i18n/text/examples/UnicodeFormatter.java

提交回复
热议问题