Skip to content
Sharp

Engineering Interviews · interview question

Which of the following is the best practice for handling exceptions in a Java application?

Multiple choiceEasychapter-20-curatedpremiumengineering-interviewscode-review-spotting-bugs
Choose one answer
Answer and explanation

Correct answer

B. Log exceptions and provide user-friendly messages

Why

Logging exceptions helps in debugging by providing detailed information about the error, while user-friendly messages help maintain a good user experience by not exposing technical details.

Test yourself on Engineering Interviews

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

Start free test
All Engineering Interviews questions →