Here you can find the source of toHexUtil(int n)
private static String toHexUtil(int n)
//package com.java2s; //License from project: Apache License public class Main { private static String toHexUtil(int n) { String rt = ""; switch (n) { case 10:/*from w w w . ja va 2 s .com*/ rt += "A"; break; case 11: rt += "B"; break; case 12: rt += "C"; break; case 13: rt += "D"; break; case 14: rt += "E"; break; case 15: rt += "F"; break; default: rt += n; } return rt; } }