Map的get(Object key)为还会该键的值,hashCode方法返回的整数是干什么的,请大家指教!

解决方案 »

  1.   

    一言难尽啊
    <thinking in java>上有比较详细的说明,楼主可以看看
      

  2.   

    一言而尽hashCode
    public int hashCode()
    Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hashCodes of each entry in the map's entrySet view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode.