📅  最后修改于: 2022-03-11 14:52:05.254000             🧑  作者: Mango
list.stream().flatMap(x -> x.stream()).collect(Collectors.toList());
// or, alternatively, with a 2d array of ints (my use-case):
Arrays.stream(list).flatMapToInt(Arrays::stream).sum();