title: Convert Decimal to Binary using Recursion Java
body: <p>I am trying to simply convert to Binary with recursion. I am having problems with the return statement. This compiles but give an overflow error when run. I don't know what to return (or if my statement is wrong) to prevent this error. </p>
  
  <p>Thanks!</p>
  
  <pre><code>public static String convertToBinary(int number)
  {
    if(number &gt; 0)
      {
        convertToBinary(number / 2);
        convertToBinary((number % 2 ));
       }
  
     return convertToBinary((number));
  }
  </code></pre>