1、因为cpu是32位的,所以每次最多加载2^32=4G的数据,所以hashcode返回int(32位)是正好的
2、一个字符串在多个应用对应的hashcode不是固定的,都是在应用是唯一的。(应用:an execution of a Java application)
“HashCode并不是要保证所有字符串的唯一性,它只是保证在当前系统的应用上是唯一的”,这里的应用指的是在运行当中的程序。
参考:
Whenever it is invoked on the same object more than once during an execution of a Java application,
the hashCode method must consistently return the same integer, provided no information used in equals
comparisons on the object is modified. This integer need not remain consistent from one execution of
an application to another execution of the same application.