Microsoft
70-511 · Question #275
You have a method named Method1. Method1 accepts a string parameter named param1. Method1 performs a complex operation on param1. You load an array of strings to a variable named array1. The array…
The correct answer is C. Arrayl.AsParallel().ForAll (Method1). See the full explanation below for the reasoning.
Question
You have a method named Method1. Method1 accepts a string parameter named param1. Method1 performs a complex operation on param1. You load an array of strings to a variable named array1. The array contains 1,000 items. You need to ensure that other methods that call Method1 can use multiple processor cores when they execute. Which code segment should you use?
Options
- AArray1.AsQueryable().AsParallel{);
- BArray1.AsQueryable().All (Method1) ;
- CArrayl.AsParallel().ForAll (Method1);
- DForeach (String item in array1) Method1(item);
How the community answered
(19 responses)- A5% (1)
- B5% (1)
- C79% (15)
- D11% (2)
Community Discussion
No community discussion yet for this question.