数值类型求和
ArrayList<Double> sumAmountResult = new ArrayList<Double>();
sumAmountResult.add(111d);
sumAmountResult.add(222d);
sumAmountResult.add(333d);
sumAmountResult.add(444d);
double sumChildAmountResult = sumAmountResult.stream().mapToDouble(Double::doubleValue).sum();
对象类型集合求和
ArrayList<Student> sumAmountResult = new ArrayList<Student>();
list.stream().mapToDouble(Student::getPMath).sum()
list.stream().mapToDouble(Student::getPMath).max()
list.stream().mapToDouble(Student::getPMath).min()
list.stream().mapToDouble(Student::getPMath).average()