Implement both Map and List interface in Java?

前端 未结 6 1780
死守一世寂寞
死守一世寂寞 2020-12-19 09:51

I\'d like to have an object that implements both the Map and the List interfaces in Java. The idea is similar to the problem in this question: Java Ordered Map

I wan

6条回答
  •  春和景丽
    2020-12-19 10:19

    LinkedHashMap does what you need.

    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 list running through all of its entries.

提交回复
热议问题