Java tutorial
//package com.java2s; public class Main { public static String int2hex(int i) { String h = ""; h = Integer.toHexString(i); if (h.length() == 1) { h = "0" + h; } return h; } }