Thanks Jeane
Hi Norm,
public class HexByte {
public static void main(
String[] args) {
char hex [] = {'0','1','2','3','4','5','6','7','8','9',
'a','b','c','d','e','f' };
byte b = (byte) 0xf1;
System.out.println("b = 0x" + hex[(b>>4) & 0x0f] + hex[b & 0x0f] );
}
}
I have worked out hex[(b>>4) & 0x0f] + hex[b & 0x0f] to be hex[15] + hex[1] but I have no idea how will hex[15] + hex[1] works out D: