Java examples for Language Basics:int
Convert decimal integer to binary number
public class Main { public static void main(String[] args) { /*from ww w . j av a2 s .c om*/ int i = 56; String strBinaryNumber = Integer.toBinaryString(i); System.out.println("Convert decimal number to binary number example"); System.out.println("Binary value of " + i + " is " + strBinaryNumber); } }