hexa and octa decimals

Hi,

I want to write a program which converts to hexadecimal and octadecimals.

first thing i don't have a fundamentals of hexadecimal and octadecimals can any one provide a link or some information on hexa and octal decimals , so that might help to workout some programs on this topic .

thanks in advance.

[332 byte] By [chiia] at [2007-10-2 21:46:52]
# 1

Hi,

This code snipped converts a Word value into a hexadecimal string of 4 bytes.

private static final byte[] aHex = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};

public static byte[] w2h(int value)

{

byte[] ret = new byte[4];

value &= 0xFFFF;

for (int n = 0; n <= 3; n++) {

ret[n] = aHex[value / 0x1000];

value = (value << 4) & 0xFFFF;

}

return ret;

}

Message was edited by:

wmestdagh

wmestdagha at 2007-7-14 1:02:29 > top of Java-index,Java Essentials,New To Java...