Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2007, 06:29 PM
Java Tip's Avatar
Moderator
 
Join Date: Nov 2007
Posts: 1,691
Rep Power: 5
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Default Stack Trace
A stack trace is used for debugging when an exception is thrown.

Code:
catch (Exception cause) {
    StackTraceElement elements[] = cause.getStackTrace();
    for (int i = 0, n = elements.length; i < n; i++) {       
        System.err.println(elements[i].getFileName() + ":" 
                      + elements[i].getLineNumber() 
                      + ">> " 
                      + elements[i].getMethodName() + "()");
    }
}
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a stack from a LinkedList Java Tip java.lang 0 04-16-2008 11:28 PM
Implementing a Stack Using two Queues rhm54 New To Java 2 01-29-2008 04:00 AM
Stack not popping bugger New To Java 2 01-28-2008 05:59 PM
Help with heap and stack coco Advanced Java 1 08-06-2007 03:21 PM
Creating a stack with data ai_2007 Advanced Java 2 07-02-2007 04:28 PM


All times are GMT +2. The time now is 01:48 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org