Javatpoint Logo
Javatpoint Logo

Java Throwable getSuppressed() method

The getSuppressed() method of Java Throwable class is used to return an array of all the exceptions that were suppressed to deliver this exception. If no exception were suppressed, an empty array will be returned.

Syntax

Return

An array of exceptions that were suppressed to deliver this exception.

Example 1

Test it Now

Output:

Caught inside Main:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at ThrowableGetSuppressedExample1.main(ThrowableGetSuppressedExample1.java:19)
Next TopicJava Throwable



Help Others, Please Share

facebook twitter pinterest