文章分类 -  2019-Java 8

摘要:在jdk7中,我们使用线程池可能会使用ExecutorService,默认有四种方式 Executors.newSingleeThreadPool() Executors.newFixedThreadPool() Executors.newCacheThreadPool() Executors.ne 阅读全文
posted @ 2019-05-29 15:40 He_quotes 阅读(16400) 评论(0) 推荐(1)
摘要:List Stream 对象调用distinct()方法,distinct()不提供按照属性对对象列表进行去重的直接实现。它是基于hashCode()和equals()工作的;判断两个对象是否相同原理与HashMap定位key原理相同,先计算hashCode,如果hashCode相同继续调用equa 阅读全文
posted @ 2019-05-24 11:41 He_quotes 阅读(3294) 评论(0) 推荐(0)
摘要:一. Future JDK 5引入了Future模式。Future接口是Java多线程Future模式的实现,在java.util.concurrent包中,可以来进行异步计算。 Future模式是多线程设计常用的一种设计模式。Future模式可以理解成:我有一个任务,提交给了Future,Futu 阅读全文
posted @ 2019-05-14 14:19 He_quotes 阅读(157) 评论(0) 推荐(0)