Java Character hashCode() MethodThe hashCode() method of Character class generally returns the hash code for the given character. The result of the given method is similar to the result of invoking the charValue() method. SyntaxParameterN.A. Return ValueThe hashCode() method of Character class returns the hash code for the given character. Example 1Output: The hashcode for the first character 'A' is given as: 65 The hashcode for the second character 'a' is given as: 97 Example 2Output: The hash code for 'M' is given as: 77 The hash code for 'N is given as: 78 The hash code for 'O' is given as: 79 The hash code for 'a' is given as: 97 The hash code for 'b' is given as: 98 The hash code for 'c' is given as: 99 Example 3Output: The hash code for '1' is given as: 49 The hash code for '2' is given as: 50 The hash code for '3' is given as: 51 Java Character hashCode(char value) MethodThe hashCode(char value) method of Character class generally returns a value of type hash code for a given char value. The result of the given method is similar to the result of Character.hashCode() method. SyntaxParametervalue: It is the char value for which there is a need to return a hash code. Return ValueThe hashCode(char value)method returns a value of type hash code for the given char value. Example 4Output: The hash code for the first character is given as: 68 The hash code for the second character is given as:100 Example 5Output: The hash code for the first character is given as: 49 The hash code for the second character is given as:51 The hash code for the second character is given as:53 Next TopicJava-character-highsurrogate-method |