java基础
羊羊羊_咩咩咩
不积跬步无以至千里!
展开
-
Java hashCode详解
hashCode方法是用来获取散列码,定义在Object类中。如果所使用的类没有重写hashCode方法的话,那么调用hashCode方法将返回该对象的存储地址。String类使用下列算法计算散列码://Stringpublic int hashCode() { int h = hash; if (h == 0 && !hashIsZero) { h = isLatin1() ? StringLatin1.hashCode(val原创 2021-04-15 12:19:24 · 1362 阅读 · 0 评论 -
Arrays.sort()方法总结
Arrays.sort()的运用1.Arrays.sort(arr);2.Arrays.sort(arr,startIndex,endIndex);不包含endIndex这个索引值3.Arrays.sort(people, new Comparator<int[]>() { @Override public int compare(int[] person1, int[] person2){ if (pers原创 2021-03-21 21:58:01 · 425 阅读 · 0 评论