Convert decimal integer to hexadecimal number in Java
Description
The following code shows how to convert decimal integer to hexadecimal number.
Example
/*from w ww. ja v a 2s .c o m*/
public class Main {
public static void main(String[] args) {
int i = 32;
String strHexNumber = Integer.toHexString(i);
System.out.println(strHexNumber);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »