Or possibly a TreeMap. In this example they will both give the same output. But if you change
then the LinkedHashMap will iterate in the order the items were added (3-2-1) while the TreeMap will iterate in the natural order of the keys (1-2-3). Choose whichever behavior seems more appropriate for your application.