Documentation for the Java Collections Framework.
- Collection Overview - Introduction to collections
- Lists - ArrayList, LinkedList, Vector
- Sets - HashSet, TreeSet, LinkedHashSet
- Maps - HashMap, TreeMap, LinkedHashMap
- Queues - Queue and Deque implementations
- Utilities - Collections and Arrays utilities
Iterable
└── Collection
├── List (ordered, allows duplicates)
├── Set (no duplicates)
└── Queue (FIFO operations)
Map (key-value pairs, separate hierarchy)
// List
List<String> list = new ArrayList<>();
list.add("item");
list.get(0);
// Set
Set<Integer> set = new HashSet<>();
set.add(1);
set.contains(1);
// Map
Map<String, Integer> map = new HashMap<>();
map.put("key", 42);
map.get("key");
// Iteration
for (String item : list) {
System.out.println(item);
}- ArrayList: Fast random access, slower insertions/deletions
- LinkedList: Fast insertions/deletions, slower random access
- HashSet: Fast lookups, no ordering
- TreeSet: Sorted set, logarithmic operations
- HashMap: Fast key-value lookups
- TreeMap: Sorted map by keys
- Understand the collection hierarchy
- Learn List implementations and use cases
- Study Set characteristics
- Master Map operations
- Explore Queue and Deque
- Use utility classes effectively
See the java-collections module for working examples.