Skip to content

Instantly share code, notes, and snippets.

@BenjaminHerbert
Created October 24, 2019 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjaminHerbert/916cc12485f1b772d4d69709b8bf103b to your computer and use it in GitHub Desktop.
Save BenjaminHerbert/916cc12485f1b772d4d69709b8bf103b to your computer and use it in GitHub Desktop.
Java - Generate variable Length Stacktrace
public class Fail {
public static void main(String[] args) {
recurse(Integer.parseInt(args[0]));
}
public static void recurse(int num) {
if (num <= 1) {
throw new RuntimeException("This is a stacktrace");
}
recurse(num-1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment