Java collections cheat sheet

Here is an overview of fundamental Java collection classes that will be useful in this course. Interface names are in italics. For full details about these classes, see the Java API Specification. You may also wish to read the chapter "java.util Part 1: The Collections Framework" in Java: The Complete Reference.

Object
  boolean equals(Object obj)
  int hashCode()
  String toString()

Comparable<T>
  int compareTo(T o)

Iterable<E>
|
+--Collection<E>
   |  boolean isEmpty()
   |  int size()
   |
   +--List<E>
   |  |  boolean add(E e)
   |  |  E get(int index)
   |  |  E set(int index, E e)
   |  |
   |  +--ArrayList<E>
   |
   +--Queue<E>
   |  |  boolean add(E e)
   |  |  E remove()
   |  |
   |  +--ArrayDeque<E>
   |  |    void addFirst(E e)
   |  |    void addLast(E e)
   |  |    E removeFirst()
   |  |    E removeLast()
   |  |
   |  +--PriorityQueue<E>
   |
   +--Set<E>
      |  boolean add(E e)
      |  boolean contains(E e)
      |  boolean remove(E e)
      |
      +--HashSet<E>

Map<K, V>
|  V get(Object key)
|  V put(K key, V val)
|  V remove(Object key)
|
+--HashMap<K, V>