How to decide usage of Java Collections ???


ArrayList – orderd, fast iteration and fast random access.
LinkedList – orderd,fast insertion and deletion
HashSet – unsorted, unordered Set. no duplicates and you don’t care about order.
LinkedHashSet– orderd, Use this class instead of HashSet when you care about the iteration order.
TreeSet– Sorted.
HashMap– unsorted, unordered. don’t care about the order.
LinkedHashMap– maintains insertion order (or, optionally, access order). slower than HashMap for adding and removing elements, you can expect faster iteration with a LinkedHashMap.
TreeMap – Sorted. TreeMap lets you pass your own comparison rules in when you construct