I\'m trying to convert a number from an integer into an another integer which, if printed in hex, would look the same as the original integer.
For example:
C
The easiest way is to use Integer.toHexString(int)
Integer.toHexString(int)
String input = "20"; int output = Integer.parseInt(input, 16); // 32