exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 157 discussion

Actual exam question from Microsoft's 70-483
Question #: 157
Topic #: 2
[All 70-483 Questions]

HOTSPOT -
You are writing a code to handle exceptions for a C# application.
You need to identify different ways to handle an exception named ex.
Which line of code should you use for each task? To answer, select the appropriate line of code for each task in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://blogs.msdn.microsoft.com/perfworld/2009/06/15/how-can-i-throw-an-exception-without-losing-the-original-stack-trace-information-in-net/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Mitsoshima
Highly Voted 6 years ago
Correct answer is: throw; throw ex; throw new Exception();
upvoted 86 times
anutural
5 years, 4 months ago
Can there be two possibility for 1st, throw and throw ex - as they both will keep the type and there is no requirement for stack track?
upvoted 3 times
...
...
xman
Highly Voted 5 years, 4 months ago
Agree with Mitsoshima it should be throw; throw ex; throw new Exception();
upvoted 8 times
...
noussa
Most Recent 4 years, 5 months ago
throw; throw ex; throw new Exception();
upvoted 2 times
...
lh2607
4 years, 11 months ago
throw; throw ex; throw new Exception();
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...