????1. ????
???????????#7 ?????HashMap??????????LinkedHashMap??????????????????????????????д???????LinkedHashMap?????
????LinkedHashMap<String?? Integer> lmap = new LinkedHashMap<String?? Integer>();
????lmap.put("????"?? 1);
????lmap.put("???"?? 2);
????lmap.put("???"?? 3);
????lmap.put("???"?? 4);
????lmap.put("????"?? 5);
????lmap.put("????"?? 6);
????lmap.put("????"?? 7);
????lmap.put("???"?? 8);
????for(Entry<String?? Integer> entry : lmap.entrySet()) {
????System.out.println(entry.getKey() + ": " + entry.getValue());
????}
???????н?????
????????: 1
???????: 2
???????: 3
???????: 4
????????: 5
????????: 6
????????: 7
???????: 8
?????????????????HashMap?????н???????LinkedHashMap????????????????????????????????????LinkedHashMap?????????????????????????????LinkedHashMap????????????????????????????

??????????????????????
????Hash table and linked list implementation of the Map interface?? with predictable iteration order. This implementation differs from HashMap in that it maintains a doubly-linked listrunning through all of its entries. This linked list defines the iteration ordering?? which is normally the order in which keys were inserted into the map (insertion-order).
????LinkedHashMap??Hash????????????????????????????????????????????????
????2. ???????????????
??????HashMap?????????????壺
????// Callbacks to allow LinkedHashMap post-actions
????void afterNodeAccess(Node<K??V> p) { }
????void afterNodeInsertion(boolean evict) { }
????void afterNodeRemoval(Node<K??V> p) { }
????LinkedHashMap?????HashMap?????????????????3??????????????????????????????÷??????????????????????????????Щ???顣