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

Eccouncil Exam 312-96 Topic 1 Question 19 Discussion

Actual exam question for Eccouncil's 312-96 exam
Question #: 19
Topic #: 1
[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:

Tijuana
30 days ago
I bet the person who wrote option D) was just trying to be creative. Nice try, but C) is the only way to go if you want to keep your console clean and tidy.
upvoted 0 times
Jani
2 days ago
Option C) ex.getMessage() is the best choice to avoid cluttering the console with stack trace.
upvoted 0 times
...
Ena
5 days ago
I always use ex.getMessage() instead of ex.printStackTrace(), keeps things neat.
upvoted 0 times
...
Merissa
10 days ago
Yeah, C) is the standard method to avoid printing the stack trace. It's important to keep things tidy.
upvoted 0 times
...
Galen
14 days ago
Yeah, C) is the standard method to avoid printing stack trace on error.
upvoted 0 times
...
Kathrine
15 days ago
I agree, option D) seems like a creative attempt but C) is definitely the way to go.
upvoted 0 times
...
Tijuana
27 days ago
Option D) is definitely a creative attempt, but I agree that C) is the way to go for a clean console.
upvoted 0 times
...
...
Stephen
1 months ago
Ah, the age-old question of how to avoid drowning in a sea of stack traces. C) ex.getMessage() is the lifesaver you're looking for, my friends.
upvoted 0 times
Sharan
19 days ago
B) ex.message() is not the correct method to use.
upvoted 0 times
...
Jeanice
21 days ago
C) ex.getMessage() is the way to go.
upvoted 0 times
...
...
Alpha
2 months ago
A) ex.StackTrace.getError()? What kind of weird syntax is that? C) is the only valid option here.
upvoted 0 times
...
Crista
2 months ago
D) ex.getError() doesn't seem right. Isn't that a method from a different language? C) is the Java way to do it.
upvoted 0 times
...
Earnestine
2 months ago
B) ex.message() sounds like it might work, but I'm pretty sure that's not a real method. C) is the way to go.
upvoted 0 times
...
Lawana
2 months ago
I think C) ex.getMessage() is the correct answer. It's a standard way to get the error message without printing the full stack trace.
upvoted 0 times
Nickolas
28 days ago
Yes, ex.getMessage() will give us the error message without printing the full stack trace.
upvoted 0 times
...
Wilburn
1 months ago
I agree, C) ex.getMessage() is the correct method to use.
upvoted 0 times
...
...
Tricia
2 months ago
I believe the correct answer is C) ex.getMessage() because it returns the error message without printing the stack trace
upvoted 0 times
...
Dante
2 months ago
I'm not sure, but I think D) ex.getError() might also work
upvoted 0 times
...
Lucina
2 months ago
I agree with Alecia, using ex.getMessage() will avoid printing the stack trace
upvoted 0 times
...
Alecia
2 months ago
I think the answer is C) ex.getMessage()
upvoted 0 times
...

Save Cancel