Double.GetHashCode() Method in C# Last Updated : 18 Jan, 2023 Comments Improve Suggest changes Like Article Like Report Double.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 Double.GetHashCode() Method: Example 1: csharp // C# program to demonstrate the // Double.GetHashCode() Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // Declaring and initializing value1 double value1 = 10d; // getting the HashCode // using GetHashCode() method int value = value1.GetHashCode(); // Display the HashCode Console.WriteLine("HashCode is {0}", value); } } Output:HashCode is 1076101120 Example 2: csharp // C# program to demonstrate the // Double.GetHashCode() // Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // calling get() method get(5d); get(5.5d); get(10d); get(7.5d); } // defining get() method public static void get(double value1) { // getting the HashCode // using GetHashCode() method int value = value1.GetHashCode(); // Display the HashCode Console.WriteLine("HashCode is {0}", value); } } Output:HashCode is 1075052544 HashCode is 1075183616 HashCode is 1076101120 HashCode is 1075707904 Reference: https://docs.microsoft.com/en-us/dotnet/api/system.double.gethashcode?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article Double.GetHashCode() Method in C# rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Double-Struct Similar Reads DateTime.GetHashCode() Method in C# This 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 DateTime.GetHashCode() Method: Example 1: csharp // C# program to demonstrate the // Da 1 min read DateTimeOffset.GetHashCode Method in C# DateTimeOffset.GetHashCode Method is used to get the hash code for the current DateTimeOffset object. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of DateTimeOffset.GetHashCode() Method: Example 1: 2 min read C# | Byte.GetHashCode() Method This method is used to return the hash code for the given byte.Syntax: public override int GetHashCode (); Return Value: This method returns a hash code for the current Byte.Below programs illustrate the use of Byte.GetHashCode() Method:Example 1: CSHARP // C# program to demonstrate // Byte.GetHashC 2 min read C# | Uri.GetHashCode() Method Uri.GetHashCode() Method is used to get the hash code for the URI. Syntax: public override int GetHashCode (); Return Value: This method returns an Int32 containing the hash value generated for this URI. Below programs illustrate the use of Uri.GetHashCode() Method: Example 1: csharp // C# program t 1 min read C# | Type.GetHashCode() Method Type.GetHashCode() Method is used to return the hash code for this instance. Syntax: public override int GetHashCode (); Return Value: This method returns the hash code for the current instance. Below programs illustrate the use of Type.GetHashCode() Method: Example 1: csharp // C# program to demons 2 min read Like