List<String> items = Arrays.asList("a", "b", "c");
items.parallelStream().forEach(e -> e = e + "fff");
System.out.println("case1 " + items);
items = items.parallelStream().map(e -> {
e = e + "fff";
return e;
}).collect(Collectors.toList());
System.out.println("case2 " + items);
Why items value not changed in case1 ?
if items contains many DTOs, and I just want to change one field in DTO , then must use parallelStream().map().collect()? why can't just use parallelStream().forEach() ?