I have this Code:
String hexCode = "A1E1F1";
int länge = hexCode.length ();
int i;
for (i = 0; i <= länge - 1 ; i ++) {
char pos = hexCode.charAt(i);
String binCode = Integer.toBinaryString(pos);
System.out.print ( binCode);
When I run it I get this result:
100000111000110001011100011000110110001
Which I don't believe is correct. Shouldn't it be:
101000011110000111110001
Are these results actually the same? Why does java give me the first result?