Which method in Throwable is used to get the cause of exception?

  1. cause()
  2. getCause()
  3. getError()
  4. findCause()
Correct answer getCause()

Explanation

getCause() returns the cause of the exception (if any).

Update: Admin added a tag on this question

Topics

By Admin · · 29 views