Does HashTable maintains the insertion order?

后端 未结 5 778
醉酒成梦
醉酒成梦 2021-01-07 18:57

The following code gives me the output in the same order of insertion. I read the javadoc and they did not even talk about the insertion order. Can someone help me to get th

5条回答
  •  天涯浪人
    2021-01-07 19:25

    LinkedHashMap is used for maintaining order of inserting elements.. Hashtable is similar to HashMap but it doesn't allow null key or value while HashMap allows one null key and several null values...

提交回复
热议问题