Skip to content

Instantly share code, notes, and snippets.

@ellbur
Created November 15, 2011 20:15
Show Gist options
  • Select an option

  • Save ellbur/1368188 to your computer and use it in GitHub Desktop.

Select an option

Save ellbur/1368188 to your computer and use it in GitHub Desktop.
How deep is your stack?
public class Counter {
public static void main(String[] args) {
foo(0);
}
static int foo(int count) {
count = count + 1;
System.out.println(count);
foo(count);
return count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment