String a=Integer.toString(32, 16).toUpperCase();
无符号16进制怎么转换?
5 个解决方案
#1
int i = 32;
System.out.println(Integer.toHexString(i));
System.out.println(Integer.toHexString(i));
#2
1楼正解
#3
方法多了去了:
System.out.println(Integer.toHexString(32));
System.out.printf("%x\n", 32);
System.out.println(String.format("%x\n", 32));
System.out.println(Integer.toHexString(32));
System.out.printf("%x\n", 32);
System.out.println(String.format("%x\n", 32));
#4
没错,直接String result=Integer.toHexString(32);即可
#5
+1
#1
int i = 32;
System.out.println(Integer.toHexString(i));
System.out.println(Integer.toHexString(i));
#2
1楼正解
#3
方法多了去了:
System.out.println(Integer.toHexString(32));
System.out.printf("%x\n", 32);
System.out.println(String.format("%x\n", 32));
System.out.println(Integer.toHexString(32));
System.out.printf("%x\n", 32);
System.out.println(String.format("%x\n", 32));
#4
没错,直接String result=Integer.toHexString(32);即可
#5
+1