你的位置:首页 > 软件开发 > Java > Java中的哈希值

Java中的哈希值

发布时间:2015-11-26 18:00:02
下面都是从String类的源码中粘贴出来的 1 private int hash; // Default to 0 2 public int hashCode() { 3 int h = hash; 4 if (h == 0 && value.le ...

下面都是从String类的源码中粘贴出来的

 1 private int hash; // Default to 0 2 public int hashCode() { 3     int h = hash; 4     if (h == 0 && value.length > 0) { 5       char val[] = value; 6       for (int i = 0; i < value.length; i++) { 7         h = 31 * h + val[i]; 8       } 9       hash = h;10     }11     return h;12 }

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:Java中的哈希值

关键词:JAVA

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。