Created
April 3, 2018 20:58
-
-
Save zgulde/43457cf0d3df92c3a31a30a68384ffdf to your computer and use it in GitHub Desktop.
Example of Java Stack Traces
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 StackTraceExample { | |
private static void a() throws Exception { | |
b(); | |
} | |
private static void b() throws Exception { | |
c(); | |
} | |
private static void c() throws Exception { | |
d(); | |
} | |
private static void d() throws Exception { | |
throw new Exception("Something Bad Happened!"); | |
} | |
private static void x() { | |
y(); | |
} | |
private static void y() { | |
z(); | |
} | |
private static void z() { | |
try { | |
a(); | |
} catch (Exception e) { | |
throw new RuntimeException("Ahhhhhh!!!!", e); | |
} | |
} | |
public static void main(String[] args) { | |
x(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment