Re: Binary to Hexadecimal Conversion



On Sat, 30 Dec 2006 09:31:44 -0000, lei <m_de_robles@xxxxxxxxx> wrote:

you can also suggest for improvements..thanks!

It could be so much simpler:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String, int)
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#toHexString(int)

Everything after reading the input could be replaced with this one line:

Integer.toHexString(Integer.parseInt(input, 2));

Dan.

--
Daniel Dyer
https://watchmaker.dev.java.net - Evolutionary Algorithm Framework for Java
.