标签:print cto 集合 ima book ring 技术 img 获取
List<Book> list = Lists.newArrayList();
list.add(new Book("1", "sql基础大全", 200));
list.add(new Book("2", "Java基础", 500));
System.out.println(list);
List<String> nameList = list.stream().map(Book -> Book.getName()).collect(Collectors.toList());
System.out.println(nameList);
输出结果:
标签:print cto 集合 ima book ring 技术 img 获取
原文地址:https://www.cnblogs.com/kc19941205/p/12100958.html