c# - How Array.Sort sort a class that contains strings and doubles? -
in code i'm looking through writer goes:
individual[] candidates = new individual[tournsize]; (int = 0; < tournsize; ++i) candidates[i] = population[indexes[i]]; array.sort(candidates);
which property sort if class contains: string s; , double d.
specified in documentation, https://msdn.microsoft.com/en-us/library/6tf1f0bc(v=vs.110).aspx, each element must support icomparable
, in case result sorted definitions, , if element doesn't support interface result undefined.