Collections Framework
import java.util.*;
List<String> list = new ArrayList<>();
list.add("Alice");
list.add("Bob");
Map<String, Integer> map = new HashMap<>();
map.put("Alice", 25);
Set<Integer> set = new HashSet<>();
Iteration
for (String item : list) { System.out.println(item); }
list.stream().filter(s -> s.startsWith("A")).forEach(System.out::println);
Summary
- ArrayList, HashMap, HashSet are the most used collections
- Streams provide functional-style operations
YouTip