![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java随笔
Madoka_Homura
这个作者很懒,什么都没留下…
展开
-
Java Comparator使用指南 ---- 看这一篇就够了
目录Comparator:Comparator的Default方法:Comparable接口在Java学习过程中,Arrays.sort()可以说是我写过最多的一个方法之一。但在很多时候,仅仅是对数组的升序排序并不能满足我们的要求。例如对复杂的对象数组进行排序,或是对大量对象进行分组。为此,Java提供了比较器来解决此类问题.上来先举个例子:class People{ String name; int age; int id; public.原创 2020-07-16 14:49:57 · 23669 阅读 · 0 评论 -
关于Integer的缓存机制所引出的问题
在复习Java基础时看到这样一个问题:public static void main(String[] args) { Integer a = 800; Integer b = 800; System.out.println((a == b) +" "+ a.hashCode()+" "+b.hashCode()); Integer c = new Integer(8); Integer d = new Integer(原创 2020-07-11 11:43:41 · 313 阅读 · 1 评论