Here you can find the source of toHex(int decimalDigit)
public static char toHex(int decimalDigit)
//package com.java2s; //License from project: Open Source License public class Main { public static char toHex(int decimalDigit) { return decimalDigit < 10 ? (char) (decimalDigit + '0') : (char) (decimalDigit - 10 + 'A'); }/*from w w w . j a v a 2s . c om*/ }