📌  相关文章
📜  java 将二维数组转换为一维流 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.254000             🧑  作者: Mango

代码示例1
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();