Skip to content

Instantly share code, notes, and snippets.

@nikhil-miranda
Last active November 8, 2023 19:47
Show Gist options
  • Save nikhil-miranda/907738de40157250714ee892083eeb77 to your computer and use it in GitHub Desktop.
Save nikhil-miranda/907738de40157250714ee892083eeb77 to your computer and use it in GitHub Desktop.
The Ultimate Guide to Java Collections Framework [in 2023]

The Ultimate Guide to Java Collections Framework [in 2023]

Collection Interface Ordered Sorted Thread safe Duplicate Nullable
ArrayList List Yes No No Yes Yes
Vector List Yes No Yes Yes Yes
LinkedList List, Deque Yes No No Yes Yes
CopyOnWriteArrayList List Yes _No Yes Yes Yes
HashSet Set No No No No One null
LinkedHashSet Set Yes No No No One null
TreeSet Set Yes Yes No No No
CopyOnWriteArraySet Set Yes No Yes No One null
ConcurrentSkipListSet Set Yes Yes Yes No No
HashMap Map No No No No (key) One null (key)
HashTable Map No No Yes No (key) No (key)
LinkedHashMap Map Yes No No No (key) One null (key)
TreeMap Map Yes Yes No No (key) No (key)
ConcurrentHashMap Map No No Yes No (key) No
ConcurrentSkipListMap Map Yes Yes Yes No (key) No
ArrayDeque Deque Yes No No Yes No
PriorityQueue Queue Yes No No Yes No
ConcurrentLinkedQueue Queue Yes No Yes Yes No
ConcurrentLinkedDeque Deque Yes No Yes Yes No
ArrayBlockingQueue Queue Yes No Yes Yes No
LinkedBlockingDeque Deque Yes No Yes Yes No
PriorityBlockingQueue Queue Yes No Yes Yes No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment