Using the Integer class, it is easy to convert an integer value from decimal to binary, octal, or hexadecimal. The relevant static methods on the Integer class are the toBinaryString(), toOctalString(), and toHexString() methods. In this phrase, we use each of these methodseach time passing in an integer value and getting a String returned that contains the integer in binary, octal, and hex format, respectively. |