/** * Add two numbers using recursion, pretending you only * know how to add and subtract 1. * @author ggtowell * Created: Aug 2023 * Modified: Oct 27, 2023 */ public class Radder { public static void main(String[] args) { System.out.println(rAdder(5, 4)); } /** * The recursive method of doing addition * @param firstNum * @param secondNum * @return */ public static int rAdder(int firstNum, int secondNum) { if (secondNum == 0) { return firstNum; } return rAdder(firstNum, (secondNum - 1)) + 1; } }