Choosing the right collection
Here is a quick guide for selecting the proper implementation of a Set, List, or Map in your application.
The best general purpose or ‘primary’ implementations are likely ArrayList, LinkedHashMap, and LinkedHashSet. Their overall performance is better, and you should use them unless you need a special feature provided by another implementation. That special feature is usually ordering or sorting.
Here, “ordering” refers to the order of items returned by an Iterator, and “sorting” refers to sorting items according to Comparable or Comparator.