Created
October 24, 2019 15:58
-
-
Save BenjaminHerbert/916cc12485f1b772d4d69709b8bf103b to your computer and use it in GitHub Desktop.
Java - Generate variable Length Stacktrace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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