I’m looking at the interface IDictionary<T, U>. One weird thing I noted in the list of methods that must be implemented is CopyTo with the description:
Copies the elements of the ICollection to an Array, starting at a
particular Array index.
What does this even mean in the context of a dictionary? Does this mean copy the values to the array or the keys or KeyValuePairs or what?
Since
IDictionary<TKey, TValue>implementsICollection<KeyValuePair<TKey, TValue>and theCopyTomethod’s type the generic parameter for theICollection<T>interface it will return an array ofKeyValuePair<TKey, TValue>objects.