Collections
HashMap vs ArrayList performance am I correct
When you need a structure from which you will be retrieving items randomly - use a HashMap
When you will be retrieving items in order (e.g. using a for loop) - use an ArrayList
There's also a combined data structure, the LinkedHashMap, which offers fast access to arbitrary elements as well as predictable ordering.
However, it's worth noting that ArrayList and HashMap are only two implementations of the List and Map interfaces, respectively. There are other implementations of each that might be more suitable for more specific requirements.
LinkedList might provide higher performance than an ArrayList for certain queueing/dequeueing requirements.