Convert from decimal to binary : Binary « Data Type « Java

Convert from decimal to binary

public class Main {
  public static void main(String[] args) throws Exception {

    int i = 42;
    String bin = Integer.toBinaryString(i);


Related examples in the same category

1.Convert Decimal to Binary
2.Convert decimal integer to binary number example
3.Parsing and Formatting a Number into Binary Bit String
5.This class allows a number to be easily formatted as a binary number.