0 out of 1 rated this helpful - Rate this topic

Object.GetHashCode Method

.NET Micro Framework 3.0
Serves as a hash function for a particular type.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

[MethodImplAttribute]
public virtual int GetHashCode ()

Return Value

A hash code for the current object.

You can use the GetHashCode method to hash algorithms and data structures (such as hash tables).

The GetHashCode method can be overridden by a derived class. Value classes must override this method to provide a hash function that is appropriate for the class and that ensures optimum distribution in the hash table. Classes that might be used as keys in a hash table must also override this method, because objects that are used as keys in a hash table are required to generate their own hash code by using this method.

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.