Created
October 9, 2017 19:49
-
-
Save zGrav/f7e238eaae4ee83221f8b329a15669bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 StackTrace { | |
public static void main(String[] args) { | |
recurse(10); | |
} | |
static void recurse(int depth) { | |
for (StackTraceElement each: new Exception().getStackTrace()) System.out.println(each); | |
if (depth > 0) recurse(depth - 1); | |
System.out.println(depth); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment