创建list
List<String> names = users.stream().map(User::getName).collect(Collectors.toList());
求和
double totalScore = users.stream().mapToDouble(User::getScore).sum()
创建list
List<String> names = users.stream().map(User::getName).collect(Collectors.toList());
求和
double totalScore = users.stream().mapToDouble(User::getScore).sum()