Outputting a leading zero an int variable
<p>I'm trying to output a series binary digits and next series of binary digits depend on the previous series's of binary digits. Some of these series lead with one or more zeroes. I can only use <code>int</code> variables.</p>

<p>So if the program starts with <code>0</code>, the next output will be <code>01</code> and then <code>0110</code> and so on.
Will I have to hard code a leading a zero if the int starts with a zero or is there another way I can do this?</p>

<p>Also, is <code>Integer.toBinaryString()</code> the only way to output a number to binary?</p>
