QuestionQ29

VerifiedSecure Coding Practices for Error Handling

Which of the following methods would you use instead of ex.printStackTrace() to avoid printing the stack trace when an error occurs?

Explanation

getMessage() retrieves an exception’s detail message without outputting the exception’s stack trace.

Community Discussion

No comments yet. Be the first to start the discussion!