Character.hashCode() in Java with examples
Java.lang.Character.hashCode() is a built-in method in Java which returns a hash code for this Character. The returned hash code is equal to the result of invoking charValue().
public int hashCode() This function does not accepts any parameter.
Return Value: This method returns a hash code value for this Character.
Below programs illustrate the Java.lang.Character.hashCode() function:
Hashcode of B is 66
Hashcode of 6 is 54
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.