Convert int to binary string in Java
Description
The following code shows how to convert int to binary string.
Example
/*from w w w. ja va 2 s .co m*/
public class Main {
public static void main(String[] arg) {
System.out.println(Integer.toBinaryString(100));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »