I have a variable define as
short s1 = 0x3039;
to do some operation, converting it to string
String ss = Integer.toHexString(s1 & 0xffff);
which give result as string "3039". After some string operation it is converted to string "3130". Now i want it back as
short s2 = 0x3130;
How can this be achieved ?
您可以将Short.parseShort
用作基数16
Short.parseShort(yourHexString, 16)
short s2 = Short.valueOf(ss2).shortValue();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.