I\'m looking for a class in java that has key-value association, but without using hashes. Here is what I\'m currently doing:
Hashtable<
You can use LinkedHashMap to main insertion order in Map
The important points about Java LinkedHashMap class are:
A LinkedHashMap contains values based on the key 3.It may have one null key and multiple null values. 4.It is same as HashMap instead maintains insertion order
public class LinkedHashMap extends HashMap implements Map
But if you want sort values in map using User-defined object or any primitive data type key then you should use TreeMap For more information, refer this link