for example number 170 (dec) if you want to convert to hex it will be AA (hex)
you can use Integer.toHexString(int)
public static void main(String[] args) { int i = 170; System.out.println("Number = " + i); /* returns the string representation of the unsigned integer value represented by the argument in hexadecimal (base 16) */ System.out.println("Hex = " + Integer.toHexString(i)); }
No comments:
Post a Comment