1、创建一个Student作为测试的集合对象
2、创建Test类进行测试筛选符合条件的数据作为新的List返回List<Student> filterList = studentList .stream().filter((Student student) -> "王麻子".equals(student.getName())) .collect(Collectors.toList());
3、输出结果
4、so easy😊
时间:2024-10-12 07:17:45
1、创建一个Student作为测试的集合对象
2、创建Test类进行测试筛选符合条件的数据作为新的List返回List<Student> filterList = studentList .stream().filter((Student student) -> "王麻子".equals(student.getName())) .collect(Collectors.toList());
3、输出结果
4、so easy😊