In java, we can call printStackTrace() method from exception object, such as: Exception ex = new Exception();
ex.printStackTrace();I remembered I used to call printStackTrace() from system.out.... I cannot remmber now. How can I print call hirerachy if I don't use exception object?
Thanks!

I can't think of any way of doing it without using an Exception object (or at least a Throwable, from which Exception is derived) but here's one way to print a stack trace: for (StackTraceElement e : new Throwable().getStackTrace()) System.out.println(e);
Thanks for your reply. I have recalled another way of doing this: Thread.dumpStack();
Thanks for sharing, that's much better.
