All three represent mapping from unique keys to values, and therefore implement the Map interface.
HashMap is a map based on hashing of the keys. It supports O(1) get/put operations. Keys must have consistent implementations of
hashCode()
andequals()
for this to work.LinkedHashMap is very similar to HashMap, but it adds awareness to the order at which items are added (or accessed), so the iteration order is the same as insertion order (or access order, depending on construction parameters).
TreeMap is a tree based mapping. Its put/get operations take O(log n) time. It requires items to have some comparison mechanism, either with Comparable or Comparator. The iteration order is determined by this mechanism.