

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
UInt64.GetHashCode() Method in C# with Examples
The UInt64.GetHashCode() method in C# is used to get the HashCode for the current UInt64 instance.
Syntax
Following is the syntax −
public override int GetHashCode ();
Example
Let us now see an example to implement the UInt64.GetHashCode() method −
using System; public class Demo { public static void Main(){ ulong val1 = 8768768; ulong val2 = UInt64.MinValue; Console.WriteLine("HashCode for val1 = "+val1.GetHashCode()); Console.WriteLine("HashCode for val2 = "+val2.GetHashCode()); } }
Output
This will produce the following output −
HashCode for val1 = 8768768 HashCode for val2 = 0
Example
Let us now see another example to implement the UInt32.GetHashCode() method −
using System; public class Demo { public static void Main(){ ulong val1 = 89879878; ulong val2 = UInt64.MaxValue; Console.WriteLine("HashCode for val1 = "+val1.GetHashCode()); Console.WriteLine("HashCode for val2 = "+val2.GetHashCode()); } }
Output
This will produce the following output −
HashCode for val1 = 89879878 HashCode for val2 = 0
- Related Questions & Answers
- Int64.GetHashCode Method in C# with Examples
- UInt32.GetHashCode() Method in C# with Examples
- UInt16.GetHashCode() Method in C# with Examples
- Int16.GetHashCode() Method in C# with Examples
- Int32.GetHashCode Method in C# with Examples
- UInt64.ToString() Method in C# with Examples
- UInt64.CompareTo() Method in C# with Examples
- UInt64.Equals Method in C# with Examples
- UInt64.GetTypeCode() Method in C# with Examples
- UInt64.MaxValue Field in C# with Examples
- UInt64.MinValue Field in C# with Examples
- C# Object.GetType() Method with Examples
- C# Queue.TrimExcess() Method with Examples
- C# Stack.TrimExcess() Method with Examples
- C# Object.GetHashCode() Method with Examples
Advertisements