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.
Thanks!
public static String convertToBinary(int number)
{
if(number > 0)
{
convertToBinary(number / 2);
convertToBinary((number % 2 ));
}
return convertToBinary((number));
}