I have a problem here. I'm supposed to explain why my String "ab" returns 3105 when i use hashCode() on it.
My main problem is that i don,t understand which value i.e s[0] has.
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
Can someone explain it? Thanks.
afrom yourabstring.