提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将十进制整数转换为十六进制数
public class Main {//from 时代Java公众号 - N o w J a v a . c o m public static void main(String[] args) { int i = 32; String strHexNumber = Integer.toHexString(i); System.out.println("Convert decimal number to hexadecimal number example"); System.out.println("Hexadecimal value of " + i + " is " + strHexNumber); } }