摘要: http://blog.csdn.net/zwy9002/article/details/7592719问题1. 不同的字符串可能会有相同的HashCode吗?答案: 可能。hashcode是用来判断两个字符串是否相等的依据,不同的字符串不可能有相同的hashcode,但不同的hashCode经过与长度的取余,就很可能产生相同的hashCode,就是所谓的哈希冲突. 如: public static void main(String[] args) { int hash1 = "ABCDEa123abc".hashCode(); int hash2 = "ABCD 阅读全文
posted @ 2013-10-29 10:17 悟寰轩-叶秋 阅读(1956) 评论(0) 推荐(0)