VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-char-gethashcode-method-with-examples/

⇱ C# | Char.GetHashCode() Method with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Char.GetHashCode() Method with Examples

Last Updated : 11 Jul, 2025

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 Char.GetHashCode() Method: 

Example 1: 

Output:
Hashcode :- 4325442

Example 2: 

Output:
Hashcode of a :- 6357089
Hashcode of b :- 6422626
Hashcode of c :- 6488163
Hashcode of x :- 7864440
Hashcode of y :- 7929977
Hashcode of z :- 7995514

Reference:

Comment

Explore