Skip to content
Sharp

Exceptions · interview question

Which method is used to retrieve the original cause of a chained exception?

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

Correct answer

B. GetCause()

Why

The getCause() method is used to retrieve the original cause of a chained exception, which is crucial for understanding the error's context.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →