I understand that while overriding equals(Object) it is good to override hashcode() method in java. (This is used in hash based collections).
Here's my Question:
Is it necessary to use an exponential function to calculate hashcode(), String class's hashcode is calculated using an exponential function:
s*31^(n-1) + s*31^(n-2) + ... + s[n-1]