![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
xiaolin93
才华撑不起抱负,就好好学习…
展开
-
2020-10-10
package com.xiaolin93.multiprocess; /** * description: PossibleReordering <br> * 验证指令重排序 */ public class PossibleReordering { static int a = 0, b = 0; static int x = 0, y = 0; public static void main(String[] args) throws Inter...原创 2020-10-10 22:55:21 · 325 阅读 · 1 评论 -
【Java源码浅谈】之HashMap和ConcurrentHashMap的区别
1:HashMap允许null值null键,而ConcurrentHashMap则不允许null值null键 2:HashMap是非线程安全的,而ConcurrentHashMap是线程安全的 3:HashMap和ConcurrentHashMap的底层都是数组+链表+红黑树 1:调用test2没有报错说明hashmap允许null值null健 2.抛异常说明ConcurrentHashMap不允...原创 2019-05-08 20:55:45 · 399 阅读 · 0 评论 -
LinkedHashMap主要源码
LinkedHashMap实现了HashMap 源码开头 public class LinkedHashMap<K,V> extends HashMap<K,V> implements Map<K,V> { 说明LinkedHashMap是实现了HashMap的,LinkedHashMap没有put方法说明时调用了父类的put方法,Ha...原创 2019-05-06 22:23:53 · 149 阅读 · 0 评论