Java examples for Language Basics:int
Convert decimal integer to hexadecimal number
public class Main { public static void main(String[] args) { /*from ww w . j ava 2s . com*/ int i = 32; String strHexNumber = Integer.toHexString(i); System.out.println("Convert decimal number to hexadecimal number example"); System.out.println("Hexadecimal value of " + i + " is " + strHexNumber); } }