Collections Framework in Java
Lessons in this section
- 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.
- ArrayList
Use ArrayList to add, remove, read, update, search, sort and loop through a resizable list, and understand capacity vs size.
- 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.
- 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.