Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java中有符号int到16位十六进制字符串_Java_Int_Hex_Short - Fatal编程技术网

Java中有符号int到16位十六进制字符串

Java中有符号int到16位十六进制字符串,java,int,hex,short,Java,Int,Hex,Short,我使用这个代码 short s = (short) Integer.parseInt("3321",16); 从3321转换为13089 如何进行反向运算并将其从13089转换为3321?

我使用这个代码

short s = (short) Integer.parseInt("3321",16);
3321
转换为
13089


如何进行反向运算并将其从
13089
转换为
3321

提供了一个解决方案


out
将具有值
“3321”

整数
提供了一个


out
将具有值
“3321”

short s=(short)Integer.parseInt(“13089”,10)?否,结果是13089short s=(short)Integer.parseInt(“13089”,10)?不,结果是13089
String out = Integer.toHexString(13089);