Map<Integer,Integer>map=newHashMap<Integer,Integer>();Date date1=newDate();for(int i=0;i<1000000;i++){map.put(i,i);}Date date2=newDate();System.out.println("HashMap的插入时间:");System.out.println(date2.getTime()-date1.getTime());Map<Integer,Integer>map1=newHashtable<Integer,...
HashTable is legacy, from Java 1. Supplanted by the ConcurrentHashMap class. Quoting the Javadoc: ConcurrentHashMap obeys the same functional specification as Hashtable, and includes versions of methods corresponding to each method of Hashtable. Share Improve this answer Follow edited Feb 6, 2020...
Comparison Chart Basis for ComparisonHashMapLinkedHashMap Basic Insertion order in HashMap is not preserved. Insertion order is preserved in LinkedHashMap. Data Structure HashMap uses HashTable to store maps. LinkedHashMap uses HashTable along with Linked List to store map. Extends/Implements Hash...