Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    public static void main(String args[]) {
        trace(Thread.currentThread().getStackTrace());

    }

    public static void trace(StackTraceElement e[]) {
        boolean doNext = false;
        for (StackTraceElement s : e) {
            if (doNext) {
                System.out.println(s.getMethodName());
                return;
            }
            doNext = s.getMethodName().equals("getStackTrace");
        }
    }
}