title: Convert integer to zero-padded binary string
body: <p>when converting int to binary, how to output it to 8 character, currently it only display 1 and short of the 7 zeros</p>
  <h2>code</h2>
  <pre><code>int x = 1;
  String bin = Integer.toBinaryString(x);
  System.Out.Println(bin);
  </code></pre>
  <p>example output to 0000 0001</p>