[Effective Java] ch1 - item11. equals를 재정의하려거든 hashCode도 재정의하라
작성중
BigInteger의 hashCode()
public class BigInteger extends Number implements Comparable<BigInteger> {
public int hashCode() {
int hashCode = 0;
for (int i=0; i < mag.length; i++)
hashCode = (int)(31*hashCode + (mag[i] & LONG_MASK));
return hashCode * signum;
}
}
댓글남기기