1. 首页
  2. 数据库
  3. 其它
  4. 不用遍历的方式在对象集合list中抽取属性集合转化为map或list

不用遍历的方式在对象集合list中抽取属性集合转化为map或list

上传者: 2020-12-31 18:46:52上传 PDF文件 29.53KB 热度 20次
首先新建一个实体类Person @Data public class Person { /** 编码 */ private String code; /** 名字 */ private String name; public Person(String code, String name) { this.code = code; this.name = name; } } 实例化三个对象放入list集合中 public static void main(String[] args) { Person pe
下载地址
用户评论