I would like a map that preserves the order of the elements if there is such a thing.
I am aware that it would not perform near as well as a HashMap, but I only plan to use it for small/temporary programs.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no ArrayMap. 🙂
But a LinkedHashMap will preserve the insertion order, and a TreeMap will order based on the keys’ natural ordering.