public class Recurser { /** * Recursion without a base case. Will keep going until stack overflow exception */ public void a(int c) { System.out.println("A" + c); a(c-1); } /** * Recursion with base case. Nicely counts down to zero. */ public void b(int c) { System.out.println("B" + c); if (c<=0) return; b(c-1); } public static void main(String[] args) { Recurser r = new Recurser(); //r.a(100); r.b(100); } }