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