Java collections maintaining insertion order

前端 未结 10 1131
忘了有多久
忘了有多久 2020-12-13 00:06

Why do some collection data structures not maintain the order of insertion? What is the special thing achieved compared to maintaining order of insertion? Do we gain someth

10条回答
  •  悲哀的现实
    2020-12-13 00:24

    Why is it necessary to maintain the order of insertion? If you use HashMap, you can get the entry by key. It does not mean it does not provide classes that do what you want.

提交回复
热议问题