Question:Suppose there is a List of type Person with a property of LastName(string) and PopulateList is a function which returns a Generic List of type Person:
List<Person> people = PopulateList();
What does the statement below do?
people.Sort((x, y) => string.Compare(x.LastName, y.LastName));
 

A It will return a newly created sorted List. 

B It will throw a compiler error. 

C It will sort the string in place. 

D It will throw InvalidOperationException at runtime. 

+ Answer
+ Report
Total Preview: 1600

Copyright © 2024. Powered by Intellect Software Ltd