G
gk
public int hashCode()
Returns a hash code for this string. The hash code for a String
object is computed as
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
How this value is calculated ?
say i have String s="abc"
so ,
s[0]= a
s[1]=b
s[2]=c
but how do i get the power of a character ?
say the first term ...
a*31^2 = whats this ? whats the neumerial value of it ?
Returns a hash code for this string. The hash code for a String
object is computed as
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
How this value is calculated ?
say i have String s="abc"
so ,
s[0]= a
s[1]=b
s[2]=c
but how do i get the power of a character ?
say the first term ...
a*31^2 = whats this ? whats the neumerial value of it ?