I'm a beginner in C# so I hope to get your help here. I just wanted to know why passing an array with a specific size adds a default element of value 0 to the HashSet. Example:
int[] arr = new int[4];
HshSet<int> myHashSet = new HashSet<int>(arr);
myHashSet.Count(); //The count is equal to 1 and the first element's value is zero.
Can you please explain to me why this happens? Is this behavior unique for HashSets only or does it also apply to the other generic collections?