Here is a Java Program to Convert an integer into binary, hexadecimal, and octal.
Output of Above Java Program
19648 in binary: 100110011000000
19648 in octal: 46300
19648 in hexadecimal: 4cc0
class StringConversions { public static void main(String args[]) { int num = 19648; System.out.println(num + " in binary: " + Integer.toBinaryString(num)); System.out.println(num + " in octal: " + Integer.toOctalString(num)); System.out.println(num + " in hexadecimal: " + Integer.toHexString(num)); } }
Output of Above Java Program
19648 in binary: 100110011000000
19648 in octal: 46300
19648 in hexadecimal: 4cc0