Here you can find the source of toHex(int i)
public static String toHex(int i)
//package com.java2s; //License from project: Apache License public class Main { public static String toHex(int i) { return "0x" + Integer.toHexString(i); }//from w w w.j ava 2 s .c o m }