“Retrieve the hash code of a string.”
String |
The hashCode()
method returns the hash code of a string.
The hash code for a String object is computed as follows:
s [0]*31^(n –1) + s [1]*31^(n –2) + … + s [n –1] |
where s[i] is the ith character of the string, n is the length of the string, and ^ indicates exponentiation.
public |
None.
Returns | An integer value representing the hash code of the string |