重写hashcode()的一般性模板代码

    xiaoxiao2021-03-25  45

    public int hashCode() {   int result = 17;   result = result * 31 + (Object).xxxx;   result = result * 31 + (Object).xxxx;

      return result;  }

    以质数17和31再与原来的hashcode相乘。

    转载请注明原文地址: https://ju.6miu.com/read-50352.html

    最新回复(0)