2020
10-09
10-09
java8从list集合中取出某一属性的值的集合案例
我就废话不多说了,大家还是直接看代码吧~List<Order>list=newArrayList<User>();Ordero1=newOrder("1","MCS-2019-1123");list.add(o1);Ordero2=newOrder("2","MCS-2019-1124");list.add(o2);Ordero3=newOrder("3","MCS-2019-1125");list.add(o3);List<String>orderNoList=list.stream().map(Order::getOrderNo).collect(Collectors.toList());System.out.println("输出单号集合:"+orderNoList);List<String>idL...
继续阅读 >