collect() — mutable accumulation into a container. reduce() — immutable combination of values. Think of collect() as filling a box — you add items to the same box over and over — while reduce() as folding items together — each fold produces a new combined result.
collect():
1List<Integer> list = stream.collect(Collectors.toList());2Map<Boolean, List<Integer>> groups = stream3 .collect(Collectors.partitioningBy(x -> x > 5));4String joined = stream.collect(Collectors.joining(", "));
reduce():
1Optional<Integer> sum = stream.reduce(Integer::sum);2Optional<Integer> max = stream.reduce(Integer::max);3int product = stream.reduce(1, (a, b) -> a * b);
Key differences: