1.前言
1)、filter的应用场景比较多
2.例子
public class Java8Filter {
public static void main(String[] args) {
List<String> list = Arrays.asList("aa","ddd");
list = list.stream().filter(item->item.length() > 2).collect(Collectors.toList());
System.out.println(list);
}
}
网友评论