List<Student> students = new ArrayList<>(); List<String> filteredStudents = students.stream() .filter(s -> s.getScore() > 80) .map(Student::getName) .sorted() .collect(Collectors.toList()); <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.4</version> </dependency>


上一篇:
下一篇:
切换中文