Java Data Type Tutorial - Java Throwable.fillInStackTrace()








Syntax

Throwable.fillInStackTrace() has the following syntax.

public Throwable fillInStackTrace()

Example

In the following code shows how to use Throwable.fillInStackTrace() method.

/*from ww  w. j a v a  2  s.  c  o m*/

public class Main {
  public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");
    
    t.fillInStackTrace();


  }

}