Multiple choice

Which method of the Throwable class returns the description of the exception in Java?

  1. void printStackTrace( )

  2. String getMessage( )

  3. String toString( )

  4. void printStackTrace(PrintWriter stream)

  5. String getLocalizedMessage( )

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Yes, this method returns a description of the exception.