stream() 获取参数和
作者:互联网
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>() {
{
this.add(1);
this.add(2);
this.add(3);
}
};
int num = list
.stream()
.reduce((a, b) -> a + b)
.get();
System.out.println(num);
}
标签:String,stream,reduce,list,获取,add,num,参数 来源: https://www.cnblogs.com/liuzonglin/p/16628865.html