📜  如何在java代码示例中删除空值

📅  最后修改于: 2022-03-11 14:52:36.686000             🧑  作者: Mango

代码示例1
2. HOW TO REMOVE NULL VALUES
List list = new ArrayList
                   (Arrays.asList("Java",null,"Python",null, "Ruby"));
CollectionUtils.filter(list, PredicateUtils.notNullPredicate()); 
                                                     ==> removes nulls
System.out.println(list);