exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 109 discussion

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

You need to write a method that combines an unknown number of strings. The solution must minimize the amount of memory used by the method when the method executes.
What should you include in the code?

  • A. The String.Concat method
  • B. The StringBuilder.Append method
  • C. The + operator
  • D. The += operator
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
A: String.Concat Method -
Concatenates one or more instances of String, or the String representations of the values of one or more instances of Object.

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
testing
Highly Voted 5 years, 9 months ago
It's B
upvoted 33 times
...
supersunny
Highly Voted 5 years, 4 months ago
B is the answer. StringBuilder is better used when no of strings not known and for large items.
upvoted 17 times
...
M62
Most Recent 3 years, 10 months ago
It is B
upvoted 1 times
...
DaGrooveNL
3 years, 10 months ago
FINAL ANSWER: B.
upvoted 1 times
...
noussa
3 years, 11 months ago
Correct answer is B
upvoted 1 times
...
CarpeDM
4 years, 2 months ago
String.Concat Method concatenates one or more instances of String, or the String representations of the values of one or more instances of Object. However, all strings to concatenate must be given as parameters. In this scenario we have an unknown number of strings and therefore cannot pass them as paramaters. the answer in this case is B
upvoted 3 times
...
ramsi05
4 years, 6 months ago
String.Concat is the same as the "+" operator (see https://docs.microsoft.com/en-us/dotnet/api/system.string.concat?view=netcore-3.1#remarks), so StringBuilder shuold be the correct answer
upvoted 3 times
...
comoon
4 years, 8 months ago
A is not correct. Each time you use Concat, it will create a new string in memory StringBuilder will work with the same object in memory
upvoted 3 times
...
JamieHaywood
4 years, 10 months ago
Answer is B https://docs.microsoft.com/en-us/dotnet/csharp/how-to/concatenate-multiple-strings "where you don't know how many source strings you are combining, and the actual number of source strings may be quite large"
upvoted 5 times
...
BitMan20
4 years, 11 months ago
>method that combines an unknown number of strings So you should use StringBuilder. Answeer is B.
upvoted 3 times
...
Gods_Kenny
5 years ago
Correct answer is B
upvoted 4 times
...
dakuan
5 years, 1 month ago
A is correct. minimize the amount of memory. StringBuild does same job, but more memory.
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago