java integer.tobinarystring leading zeros code example
Example: java integer to binary string with leading zeros
int n = 1000;
String.format("%16s", Integer.toBinaryString(n).replace(' ', '0');
int n = 1000;
String.format("%16s", Integer.toBinaryString(n).replace(' ', '0');