is hashCode() must return a prime number
- by subhashis
The signature of the hashCode() method is
public int hashCode(){
return x;
}
in this case x must be an int(primitive) but plz can anyone explain it to me that the number
which the hashCode() returns must be a prime number, even number...etc or there is no specification ? the reason behind i am asking this question is i have seen it in different ids the auto generated code always returns a prime number, so i need to know why?
thanks in advance