This is useful for long project, where we use third party APIs.
// Java Code StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); for (StackTraceElement item: stackTraceElements){ System.out.println(item); }