‘Integer.toHexString’
method is used to convert an integer to hex string.
Example
int i =
1027;
String
hexString = Integer.toHexString(i);
package com.sample.app;
public class App {
public static void main(String args[]) {
int i = 1027;
String hexString = Integer.toHexString(i);
System.out.println("Hexa form of " + i + " is " + hexString);
}
}
Output
Hexa form
of 1027 is 403
You may
like
No comments:
Post a Comment