内部结构图
实现原理
其实如果不看图中的横向引用而只看纵向向引用的话,LinkedHashMap和HashMap是差不多的,关于HashMap的结构可以查看http://blog.csdn.net/qq32933432/article/details/53013393
HashMap.Node.next相当于LinkedHashMap.Entry.after.
LinkedHashMap内部维护的Entry比HashMap中维护的Node多了一个before属性,
HashMap.Node:
static class Node<K,V> impl