0
List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");

Open 1 Answers 30 Views Education

List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");

1 Answer

0

List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");

//get count of empty string

int count = strings.parallelStream().filter(string -> string.isEmpty()).count();

//It is very easy to switch between sequential and parallel streams.

by (53.7k points)
...