Convert Integer to Hex String in Java
Description
The following code shows how to convert Integer to Hex String.
Example
// w ww . jav a 2s . com
public class Main {
public static void main(String[] arg){
System.out.println(Integer.toHexString(10));
System.out.println(Integer.toHexString(20));
System.out.println(Integer.toHexString(30));
System.out.println(Integer.toHexString(40));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »