how to remove null values in java

Solutions on MaxInterview for how to remove null values in java by the best coders in the world

showing results for - "how to remove null values in java"
Valeria
10 Jul 2016
12. HOW TO REMOVE NULL VALUES
2List<String> list = new ArrayList
3                   (Arrays.asList("Java",null,"Python",null, "Ruby"));
4CollectionUtils.filter(list, PredicateUtils.notNullPredicate()); 
5                                                     ==> removes nulls
6System.out.println(list);
7