Skip to content
Sharp

Exceptions · interview question

Which method is used to retrieve the original exception cause when an exception is wrapped?

Multiple choiceMediumchapter-6-curatedpremiumexceptionscause-chaining-and-error-context
Choose one answer
Answer and explanation

Correct answer

A. GetCause()

Why

The getCause() method is used to retrieve the original cause of an exception when it has been wrapped. This helps in understanding the root cause of the problem.

Test yourself on Exceptions

A free test with instant, explained results. No account needed.

Start free test
All Exceptions questions →