So I know how I would go about writing a function that would simply print out the converter integer into binary like this:
private void convertBinary(int num) {
if(num > 0){
convertToBinary(num/2);
System.out.print(num%2 + "");
}
}
However, I'm not sure how I would do this if I wanted to return it as a string, especially with recursion since if I initialize the string as the beginning of the method it will reset the string during each recursive call.