Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

EC-Council 312-96 Exam - Topic 7 Question 55 Discussion

Which of the following method will you use in place of ex.printStackTrace() method to avoid printing stack trace on error?
C) ex.getMessage();
A) ex.StackTrace.getError();
B) ex.message();
D) ex.getError();

EC-Council 312-96 Exam - Topic 7 Question 55 Discussion

Actual exam question for EC-Council's 312-96 exam
Question #: 55
Topic #: 7
[All 312-96 Questions]

Which of the following method will you use in place of ex.printStackTrace() method to avoid printing stack trace on error?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Carolynn
1 day ago
I think C) ex.getMessage() is the best choice.
upvoted 0 times
...
Freida
6 days ago
Yeah, C is definitely the way to go. Less clutter!
upvoted 0 times
...
Ardella
12 days ago
I feel confident about C. It's concise and effective.
upvoted 0 times
...
Eleonora
17 days ago
D) ex.getError() is also not standard. Stick with C.
upvoted 0 times
...
Selma
22 days ago
B) ex.message() sounds wrong. It's not a valid method.
upvoted 0 times
...
Felicitas
27 days ago
Agreed! It gives a clear error message without the stack trace.
upvoted 0 times
...
Leslie
1 month ago
I think C) ex.getMessage() is the best choice.
upvoted 0 times
...
Alline
1 month ago
B) ex.message() doesn't even exist, right?
upvoted 0 times
...
Lucia
1 month ago
Wait, is D) even a real method? Sounds off.
upvoted 0 times
...
Lakeesha
2 months ago
I thought it was A) at first, but I guess not.
upvoted 0 times
...
Ettie
2 months ago
Totally agree, that's the standard way to handle it!
upvoted 0 times
...
Ettie
2 months ago
C) ex.getMessage() is the right choice.
upvoted 0 times
...
Tegan
2 months ago
D) ex.getError() sounds wrong to me.
upvoted 0 times
...
Michel
2 months ago
I thought ex.printStackTrace() was the only way to debug!
upvoted 0 times
...
Willard
2 months ago
Wait, is ex.message() even a real method?
upvoted 0 times
...
Alfreda
3 months ago
Totally agree with Jaclyn!
upvoted 0 times
...
Jaclyn
3 months ago
C) ex.getMessage() is the right choice!
upvoted 0 times
...
Fatima
3 months ago
I vaguely recall that ex.printStackTrace() is used for debugging, so we definitely want to avoid that. C seems like the best choice, but I hope I'm right!
upvoted 0 times
...
Elliot
3 months ago
I'm a bit confused about the options, but I don't think A or D are valid methods. I might go with C as well.
upvoted 0 times
...
Genevieve
3 months ago
I feel like we practiced a similar question in class, and I think the right answer is C) ex.getMessage().
upvoted 0 times
...
Merrilee
5 months ago
I think I remember that using ex.getMessage() is a way to get the error message without the stack trace, but I'm not completely sure.
upvoted 0 times
...

Save Cancel