Hexadecimal to decimal and binary conversion in Java
This Java program will convert Hexadecimal number to decimal, binary
and Octal in Java programming language using JDK standard API methods. For
beginners hexadecimal is base 16 number, while decimal is base 10, Octal is
base 8 and binary is base 2 numbers in Number systems. Binary only contains 0
and 1 bits, octal contains 0 to 7, decimal contains 0 to 9 and Hexadecimal
contains 0-9,A,B,C,D,E,F where F represent 16. Thankfully Java library provides convenient method to convert any integer from one number system to another. In
our last article we have seen How
to convert decimal number to binary in Java and in this article we will convert Hexadecimal numbers to binary,
octal and decimal numbers.If you are going for programming
interviews, then its better to prepare How to do this exercise without
using Java API as well, as interviewer commonly expect programmer to create
there own method during interviews e.g. reversing
String without using StringBuffer reverse() method.