Javatpoint Logo
Javatpoint Logo

Java Throwable fillInStackTrace() method

The fillInStackTrace() method of Java Throwable class is used to fill in the execution stack trace. If the stack trace of the calling throwable is not writable, then there will be no effect of calling this method.

Syntax

Return

It returns a reference to the Throwable object.

Example 1

Test it Now

Output:

java.lang.ArithmeticException: / by zero
	at ExceptionTest.main(ExceptionTest.java:5)
Exception in thread "main" java.lang.ArithmeticException: / by zero
	at ExceptionTest.main(ExceptionTest.java:8)
Next TopicJava Throwable



Help Others, Please Share

facebook twitter pinterest