`

method call stacks

 
阅读更多

add the contents as follows:

 

 

Throwable ex = new Throwable();

    StackTraceElement[] stackElements = ex.getStackTrace();
   
    if(stackElements != null)
    {
        for(int i = 0; i < stackElements.length; i++)
        {
        System.out.println(stackElements[i].getClassName());
        System.out.println(stackElements[i].getFileName());
        System.out.println(stackElements[i].getLineNumber());
        System.out.println(stackElements[i].getMethodName());
        System.out.println("-----------------------------------");
        }
    }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics