// prints x number of $ public static void recursion(int x) { if(x == 0) { // base case System.out.println(); } else { // recursive case System.out.print("$"); recursion(x - 1); } }