Java Throwable fillInStackTrace() methodThe 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. SyntaxReturnIt returns a reference to the Throwable object. Example 1Test it NowOutput: 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
|