number to bits java code example Example: java integer to binary string int n = 1000; String s = Integer.toBinaryString(n);