C# | CharEnumerator.GetHashCode() Method Last Updated : 30 Apr, 2019 Comments Improve Suggest changes Like Article Like Report GetHashCode() Method serves as the default hash function and returns a hash code for the current object. This method is inherited from the Object class. Syntax: public virtual int GetHashCode (); Return Value: This method returns an Int32 value corresponding to the hash code of the current object. Below are the programs to illustrate the use of CharEnumerator.GetHashCode() Method: Example 1: csharp // C# program to illustrate the use // of CharEnumerator.GetHashCode() // Method using System; class GFG { // Driver code public static void Main() { // Initialize a string object string str = "GeeksforGeeks is fun"; // Instantiate a CharEnumerator object CharEnumerator chEnum1 = str.GetEnumerator(); // Instantiate another CharEnumerator object CharEnumerator chEnum2 = str.GetEnumerator(); // Printing the Hash Code of // both the CharEnumerator objects Console.WriteLine(chEnum1.GetHashCode()); Console.WriteLine(chEnum2.GetHashCode()); } } Output: -381312627 1646495825 Example 2: csharp // C# program to illustrate the use // of CharEnumerator.GetHashCode() // Method using System; class GFG { // Driver code public static void Main() { // Initialize two string object string str1 = "GeeksforGeeks is fun", str2 = "C C++ Java Python"; // Instantiate a CharEnumerator object CharEnumerator chEnum1 = str1.GetEnumerator(); // Instantiate another CharEnumerator object CharEnumerator chEnum2 = str2.GetEnumerator(); // Printing the Hash Code of // both the CharEnumerator objects Console.WriteLine(chEnum1.GetHashCode()); Console.WriteLine(chEnum2.GetHashCode()); } } Output: 491910500 -1775248344 Comment More infoAdvertise with us Next Article C# | CharEnumerator.GetHashCode() Method rupesh_rao Follow Improve Article Tags : C# CSharp-method CSharp-CharEnumerator-Class Similar Reads C# | CharEnumerator.GetType() Method CharEnumerator.GetType() Method is used to get the type of the current instance. This method is inherited from the Object Class. Syntax: public Type GetType(); Return Value: This method returns the exact runtime type of the current instance. Below are the programs to illustrate the use of CharEnumer 2 min read C# | CharEnumerator.Clone() Method CharEnumerator.Clone Method is used to create a copy of the current CharEnumerator object. This is useful for saving the current state while iterating through a String object. Syntax: public object Clone (); Return Value: This method returns an Object which is a copy of the current CharEnumerator ob 2 min read C# | CharEnumerator.Dispose() Method This method is used to releases all resources used by the current instance of the CharEnumerator class. The Dispose() method leaves the CharEnumerator in an unusable state. So, this method should be called when a user finished their working with the CharEnumerator. Syntax: public void Dispose (); Re 2 min read C# | CharEnumerator.MoveNext() Method CharEnumerator.MoveNext() Method is used to increments the internal index of the current CharEnumerator object to the next character of the enumerated string. Syntax: public bool MoveNext(); Return Value: This method returns the boolean value true value if the index is successfully incremented and w 2 min read C# | CharEnumerator.Reset() Method CharEnumerator.Reset Method is used to initializes the index to a position logically before the first character of the enumerated string. Syntax: public void Reset (); Below are the programs to illustrate the use of CharEnumerator.Reset() Method: Example 1: csharp // C# program to illustrate the // 2 min read C# | CharEnumerator.ToString() Method CharEnumerator.ToString() Method is used to get a string that represents the current object. It is inherited from the Object Class. Syntax: public virtual string ToString(); Return Value: This method returns a string which represents the current CharEnumerator object. Below are the programs to illus 2 min read Double.GetHashCode() Method in C# 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 demonst 1 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