Single.GetHashCode() Method in C# with Examples Last Updated : 01 May, 2019 Comments Improve Suggest changes Like Article Like Report Single.GetHashCode() Method is used to return the hash code for this instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of Single.GetHashCode() Method: Example 1: csharp // C# program to demonstrate the // Single.GetHashCode() Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // Declaring and initializing value1 float value1 = 10f; // getting the HashCode // using GetHashCode() method int value = value1.GetHashCode(); // Display the HashCode Console.WriteLine("HashCode is {0}", value); } } Output: HashCode is 1092616192 Example 2: csharp // C# program to demonstrate the // Single.GetHashCode() Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // calling get() method get(5f); get(9.5f); get(10000f); get(2327.5232f); } // defining get() method public static void get(float value1) { // getting the HashCode // using GetHashCode() method int value = value1.GetHashCode(); // Display the HashCode Console.WriteLine("HashCode is {0}", value); } } Output: HashCode is 1084227584 HashCode is 1092091904 HashCode is 1176256512 HashCode is 1158772831 Reference: https://docs.microsoft.com/en-us/dotnet/api/system.single.gethashcode?view=netstandard-2.1 Comment More infoAdvertise with us Next Article Single.GetHashCode() Method in C# with Examples rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Single-Struct Similar Reads SByte.GetHashCode Method in C# with Examples SByte.GetHashCode method is used to get the HashCode for the current SByte instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to il 1 min read UInt32.GetHashCode Method in C# with Examples UInt32.GetHashCode method is used to get the HashCode for the current UInt32 instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to 1 min read UInt16.GetHashCode Method in C# with Examples UInt16.GetHashCode method is used to get the HashCode for the current UInt16 instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to 1 min read UInt64.GetHashCode Method in C# with Examples UInt64.GetHashCode method is used to get the HashCode for the current UInt64 instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to 1 min read C# | Object.GetHashCode() Method with Examples This method is used to return the hash code for this instance. A hash code is a numeric value which is used to insert and identify an object in a hash-based collection. The GetHashCode method provides this hash code for algorithms that need quick checks of object equality. Syntax: public virtual int 2 min read Like