title: How to convert decimal to binary and format it in a specific way?
body: <p>When using the <code>Integer.toBinaryString()</code> method to convert decimal to binary my program keeps returning the binary code without the leading 0's in the binary representation. How can I make sure that the zeros aren't lost? For example if the code is:</p>
  
  <pre><code>String binary = Integer.toBinaryString(84);
  </code></pre>
  
  <p>I get <code>1010100</code> instead of <code>01010100</code></p>
  
  <p>How can I make sure that the leading zero doesn't disappear ?</p>