title: Integer.toString() acting weird
body: <p>bit computer in java and i have run into a weird problem. i have a binary number stored as an integer and i needed to convert it to a string but when i do the <code>Integer.toString()</code> returns 9 when i gave it 00000011 but it should have returned 3 right?
  here's the function i was making</p>
  
  <pre><code>static int binToInt(int bin)
  {
      String binary = Integer.toString(bin);
      return Integer.parseInt(binary, 2);
  }
  </code></pre>
  
  <p>Can someone explain? 
  i have been trying for over an hour to find a solution. either i find a page with something else or a tutorial of how to use <code>Integer.toString()</code></p>