Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExceptionExample
- {
- public static void main(String[] args)
- {
- method1();
- }
- public static void method1()
- {
- method2();
- }
- public static void method2()
- {
- method3();
- }
- public static void method3()
- {
- StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
- for (StackTraceElement element : stackTraceElements)
- {
- System.out.println(element.getMethodName());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment