Collections Framework in Java

Lessons in this section

  1. Collections Fundamentals

    See why collections beat arrays, how List, Set and Map fit into the Collections Framework, how to choose between them, and how to loop with for-each and Iterator.

  2. ArrayList

    Use ArrayList to add, remove, read, update, search, sort and loop through a resizable list, and understand capacity vs size.

  3. Set and Map

    Store key-value pairs with HashMap and unique items with HashSet, loop through them, use set operations, and compare them with Hashtable and TreeSet.

  4. Linear Data Structures

    Use stacks (LIFO) and queues (FIFO): push, pop and peek, Queue with LinkedList and PriorityQueue, offer vs add, poll vs remove, and real applications.