int value = 42; int hash = value.GetHashCode(); Console.WriteLine(hash); // Output: 42
string str = "Hello world!"; int hash = str.GetHashCode(); Console.WriteLine(hash); // Output: 834556218In this example, `GetHashCode` is called on a `string` instance. Since `string` is a reference type, its hash code is typically based on the contents of the string. The hash code returned by `GetHashCode` for this particular string may vary depending on the specific implementation of the method. `Int32.GetHashCode` is found in the `mscorlib.dll` assembly, which is part of the .NET Framework Class Library.