No single method in a program \"knows\" where it is on the stack. All it knows is its own little job, and it does that and returns. So when an Exception is thrown and a stack
You can know the Thread a method belongs to by using Thread.currentThread. Using this thread, you can get the StackTrace, because there is a stack for every thread in the JVM. Also, the main program runs in the main thread.