This article is a simple Java program which converts the decimal number to binary, octal and hexadecimal format. When it first came into my mind I though I would probably need to write whole code to convert decimal to various other radix or base numbers but when I looked Integer class and saw these two way of converting decimal to binary etc I was simply amazed. It’s indeed extremely easy to do this in java and you can also write this program or use it is.
Converting decimal to binary in Java ExampleJava has many ways to change number system of particular number, you can convert any decimal number into either binary system, hexadecimal system or octal system by following the same procedure. here is code example of converting any decimal number into binary number in Java.
Nice and little tip to convert decimal to binary or decimal to Octal, hex. This comes very handy many times when we want to do a quick conversion.
Related Java Tutorials