Stack Trace - Online Code

Description

Every "Exception" (or subclass) object contains a "stackTrace", ortraceback, meant to indicate where the error occurred.Let's find out where a stackTrace comes from, and how to use it, when Exceptions are created and thrown. Some textbooks claim that it is the operation of constructing the exception that anchors its trace,others the throwing. Let us see for ourselves.

Source Code

public class StackTrace {



  IllegalArgumentException ex;



  public static void main(String[] argv) {

    StackTrace st = new StackTrace();

    st.makeit();

    System.out.println("CONSTRUCTED BUT NOT THROWN
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.




Comments

No comment yet. Be the first to post a comment.