exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 18 discussion

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

You are developing an application that will read data from a text file and display the file contents.
You need to read data from the file, display it, and correctly release the file resources.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
supersunny
Highly Voted 5 years, 11 months ago
A is Correct.
upvoted 15 times
...
tanujgyan
Highly Voted 5 years, 2 months ago
All options look the same to me..I guess i am stressed lol
upvoted 6 times
tanujgyan
5 years, 2 months ago
C and D are incorrect but why not B
upvoted 1 times
tanujgyan
5 years, 2 months ago
Ok i am definitely going blind A is the right answer
upvoted 4 times
...
...
...
DaGrooveNL
Most Recent 4 years, 5 months ago
FINAL ANSWER: A.
upvoted 2 times
...
thibaultceulemans
5 years, 1 month ago
In c#8, B is definitely correct: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-statement
upvoted 3 times
gjsdevs
4 years, 7 months ago
Im no expert here, but b doesnt use any { } after using, it just has; . I think that means it doesnt actually use it for the while that follows??
upvoted 4 times
...
...
mmarinov
5 years, 1 month ago
A is the correct answer, because the StreamReader is created in the using statement so it can be properly disposed at the end. :)
upvoted 5 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 ...