I'm trying to convert hex code to the corresponding integer, which can then be used to display a character.
For example I have the code.
int i = 0xE7;
System.out.println(i);
System.out.write(i)
This produces the output as expected with the first output outputting 231, and the second line outputting the corresponding character.
My problem comes when trying to make it so the hex code is variable.
For example, I receive an output of 7
This output is then the last digit of the hex code (so i check if needs to be converted to a, b etc.) then try and combine it with the prefix 0xE to create the hex code.
I'm not quite sure how to do this bit as I cant carry out
num = 7;
hex = "0xE"+num;
int i = hex;
as the last line doesn't calculate due to hex being a string.
Many thanks for your help.