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