Unlike the List, HashSet does not store duplicate elements. NET collection that stores unique elements. To get the hash code integer value, we can Object.GetHashCode method. Comparing the integer value is much faster than comparing two objects using the equals method. That's why we use a hash code as a value in a HashSet collection.
0 Comments
Leave a Reply. |