//输出List StudentInfo.printStudents(studentList); //从对象列表中提取一列(以name为例) List<String> nameList = studentList.stream().map(StudentInfo::getName).collect(Collectors.toList()); //提取后输出name nameList.forEach(s-> System.out.println(s));
2021-12-03 02:31:47
//输出List StudentInfo.printStudents(studentList); //从对象列表中提取一列(以name为例) List<String> nameList = studentList.stream().map(StudentInfo::getName).collect(Collectors.toList()); //提取后输出name nameList.forEach(s-> System.out.println(s));
下一篇:MySQL查看视图