List<String> list = new ArrayList<String>(Arrays.asList("", "Hi", null, "How"));
System.out.println(list);
list.removeAll(Arrays.asList("", null));
System.out.println(list);
Output:
[, Hi, null, How]
[Hi, How]
More Related Contents:
- JAVA: calculate the average between two or more arrays [closed]
- Write a function that will sort a string array using Java
- JAVA ArrayIndexoutofBoundException issue
- Write a program that takes an array/arraylist of integer and finds longest sub array/arraylist whose entries are equal [closed]
- How to add two int array values together?
- How to split a String by space
- Convert list to array in Java [duplicate]
- The best way to print a Java 2D array? [closed]
- Converting array to list in Java
- Accessing members of items in a JSONArray with Java
- How to sort an array of objects in Java?
- How do I copy a 2 Dimensional array in Java?
- What is the Cost of Calling array.length
- How to convert object array to string array in Java
- How to return an array from JNI to Java?
- How to convert a Java 8 Stream to an Array?
- How is length implemented in Java Arrays?
- How do I fill arrays in Java?
- Scanner class skips over whitespace
- How do I create a jagged 2d array in Java?
- How can I generate a list or array of sequential integers in Java?
- Fill arrays with ranges of numbers
- How to increase an array’s length
- Java ArrayIndexOutOfBounds Exception
- How do I paint multiple objetcs that move at different speeds in Java?
- How does primitive array work with new for each loop in Java?
- How do I convert Double[] to double[]?
- How to sort an array of objects containing null elements?
- Finding if an array contains all elements in another array
- How to deep copy an irregular 2D array