Java tutorial
//package com.java2s; public class Main { public static String intToHexString(int a) { StringBuilder stringBuilder = new StringBuilder(""); int v = a & 0xFF; String hv = Integer.toHexString(v); if (hv.length() < 2) { stringBuilder.append(0); } stringBuilder.append(hv); return stringBuilder.toString(); } }