摘要: Java深入学习08:CountDownLatch应用 一、CountDownLatch是什么 A synchronization aid that allows one or more threads to wait until a set of operations being performe 阅读全文
posted @ 2020-03-17 17:56 我不吃番茄 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Java深入学习07:ConcurrentModificationException异常和CopyOnWriteArrayList 一、先看一个单线程Iterator遍历读写异常 1-代码如下:创建一个ArrayList,并添加三个元素;开启1个线程,遍历该ArrayList,一边读取数据,一边删除 阅读全文
posted @ 2020-03-17 15:43 我不吃番茄 阅读(506) 评论(0) 推荐(0) 编辑
摘要: Java深入学习06:HashCode和equal方法 一、HashCode是什么 hashcode就是通过hash函数得来的,通俗的说,就是通过某一种算法得到的,hashcode就是在hash表中有对应的位置。 hash函数中的实现就是一种算法,就是通过一系列的算法来得到一个hash值。这个时候, 阅读全文
posted @ 2020-03-17 10:53 我不吃番茄 阅读(251) 评论(0) 推荐(0) 编辑