Does HashTable maintains the insertion order?

后端 未结 5 767
醉酒成梦
醉酒成梦 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:27

    no, it does not. it only knows the "hash" order. if you reorder the strings, you will find they still appear in the same order from the hashtable.

提交回复
热议问题